copyright-header | Copyright Header is a utility to manipulate software
kandi X-RAY | copyright-header Summary
kandi X-RAY | copyright-header Summary
Copyright Header is a utility to manipulate licenses on source code.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Transform a file into the configuration .
- Write content to file
- Load the configuration file
- Execute the command
- Formats a new license line
- Return the file extension .
- Run the command
- Wrap the given text to a string
- Initialize a new Directory .
- Remove a directory from the directory .
copyright-header Key Features
copyright-header Examples and Code Snippets
Community Discussions
Trending Discussions on copyright-header
QUESTION
I work on a project where the copyright headers are mandatory. All files have them but recently the guidelines for the headers changed and hence need to be updated. I am working on Linux platform (but files are accessible through Windows as well). Some files have the new headers (but need to be updated in the year field), some have the old header, some have it in a very crude manner not conforming to the standard (yes, they unfortunately got through review) and some don't have it at all (yes, these too got through review).
Hence I had three requirements:
Change the old headers to the updated headers, along with updated years
For those which have new headers, their date(more precisely year) needs to be updated.
Add headers to those that don't have any
I don't want to do this for all files in the project, only ones that I am changing for my fix. In other words, only files shown in output of git status. The possible scenarios while updating the date can be:
- 2011-2014, 2016 ==> 2012-2014,2016-2017
- 2011-2012, 2014-2015 ==> 2011-2012, 2014-2015, 2017
- 2011-2016 ==> 2012-2017
- 2011-2017 ==> No change
Also it's .java, .cpp, .c, .h and .xml files in the project.
I saw this but it only appears to add headers. I am not too proficient in sed and awk. I went through this but it assumes a standard start of all files and this but it too involves a common header. Is it possible to do this ?
EDIT: I accepted @Hoall ' s answer and did it manually since doing it using sed seemed too troublesome for now!
...ANSWER
Answered 2017-Jun-26 at 15:03Under linux you could do somthing like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install copyright-header
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page