0# Copy License
1Copies software licenses into your project.
2Optionally, it also adds the short variant of the license into your main file.
5## Usage
6### Create license in directory
7`./cp-license.py [license short name] [destination directory] [author] [date]`
9Consult the help menu for all options and more information:
10`./cp-license.py h`
13### Add license into your file
14`./cp-license pre [license short name] [author] [date] [language] [source file]`
16More information about the prepend-mode:
17`./cp-license.py h pre`
20## Examples
21**Add a license to your project:**
22`./cp-license.py mit ~/foo/bar/my_project_dir`
24**Some licenses have a "author" & "year" placeholder. You can populate them directly:**
25`./cp-license.py mit ~/foo/bar/my_project_dir Peter 2025`
27_You can omit the date `2025` and it will use the current year._
29**Add a short variant of the license into your main file:**
30`./cp-license.py pre gpl3 Peter 2025 c src/main.c`
32_If you replace `2025` with `0`, it will use the current year._
34**You can also omit the author and date:**
35`./cp-license.py pre gpl3 c src/main.c`
38## Notes on `pre, prepend`
39- it will always create a backup of your file, before writing into it.
40- if a backup exists, it does not overwrite the backup
41- if a shebang `#!` and/or editor mode `-*-` exists, it will append the license text below it
44## Add a new license
45Please consult `cp-license.py` and look for the docstring `# How to add a new license`.
48## Add a new language comment token
49Consult `cp-license.py` and look for `# How to add a new language comment token`
index : cp-license
---