Logo

index : cp-license

---

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/cp-license.git/html/README.md blob: 36d321c85c85040f7e01da9b48c86fffb1673b8f [raw] [clear marker]

        
0# Copy License
1Copies software licenses into your project.
2Optionally, it also adds the short variant of the license into your main file.
3
4
5## Usage
6### Create license in directory
7`./cp-license.py [license short name] [destination directory] [author] [date]`
8
9Consult the help menu for all options and more information:
10`./cp-license.py h`
11
12
13### Add license into your file
14`./cp-license pre [license short name] [author] [date] [language] [source file]`
15
16More information about the prepend-mode:
17`./cp-license.py h pre`
18
19
20## Examples
21**Add a license to your project:**
22`./cp-license.py mit ~/foo/bar/my_project_dir`
23
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`
26
27_You can omit the date `2025` and it will use the current year._
28
29**Add a short variant of the license into your main file:**
30`./cp-license.py pre gpl3 Peter 2025 c src/main.c`
31
32_If you replace `2025` with `0`, it will use the current year._
33
34**You can also omit the author and date:**
35`./cp-license.py pre gpl3 c src/main.c`
36
37
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
42
43
44## Add a new license
45Please consult `cp-license.py` and look for the docstring `# How to add a new license`.
46
47
48## Add a new language comment token
49Consult `cp-license.py` and look for `# How to add a new language comment token`
50
51
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit