diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 124 |
1 files changed, 77 insertions, 47 deletions
diff --git a/README.md b/README.md index e48d546..0e71ae5 100644 --- a/README.md +++ b/README.md | |||
@@ -1,74 +1,104 @@ | |||
1 | # licenser: plop a license in there | 1 | # licensor: plop a license in there |
2 | 2 | ||
3 | Are you tired of copying and pasting licenses into your new projects? | 3 | Are you tired of copying and pasting licenses into your new projects? |
4 | Do you always forget what the dang github api thing is? | 4 | Do you always forget what the dang github api thing is? |
5 | Or I don't know, have some other reason why doing licenses is hard? | 5 | Or I don't know, have some other reason why doing licenses is hard? |
6 | 6 | ||
7 | Well now you don't have to worry! | 7 | Well now you don't have to worry! |
8 | Just run `licenser` in your new repo and BLAMMO! | 8 | Just run `licensor` in your new repo and BLAMMO! |
9 | Done. | 9 | Done. |
10 | 10 | ||
11 | ## Usage | 11 | ## Usage |
12 | 12 | ||
13 | literally taken from `licenser -h` | 13 | literally taken from `licensor -h`: |
14 | 14 | ||
15 | ``` | 15 | ``` |
16 | licenser: plop a license in your project | 16 | licensor: easily provide a license for a project |
17 | 17 | USAGE: licensor [-h|-l|-L] | |
18 | usage: licenser [-h|-m|-M] | 18 | licensor -s QUERY |
19 | licenser [-f] [-q] [-y YEAR] [-a AUTHOR] [-e EMAIL] | 19 | licensor [FLAGS] [OPTIONS] [LICENSE] |
20 | [-l LANG] [-o FILE] [LICENSE] | 20 | |
21 | flags: | 21 | FLAGS: |
22 | -h show this help and exit | 22 | -h Display this help and exit. |
23 | -m list available licenses and exit | 23 | -l List available licenses and exit. |
24 | -M list licenses, disregarding cached manifest | 24 | -L List available licenses, disregarding cache. |
25 | -f overwrite existing license | 25 | This flag will re-download the license repo. |
26 | -q quiet: don't log anything | 26 | |
27 | options: | 27 | -f Overwrite existing license. |
28 | -y YEAR set copyright date(s) to YEAR. | 28 | -q Be quiet (don't log anything). |
29 | default: $(date +%Y). | 29 | -z Fold output to 70 characters (see -w). |
30 | this option accepts arbitrary input. | 30 | -Z Disable folding of output. |
31 | -a AUTHOR set copyright holder(s) to AUTHOR. | 31 | -p Include "optional" license content. |
32 | default: | 32 | -P Don't include "optional" content. |
33 | - git config --get user.name | 33 | |
34 | - getent password $USER | 34 | OPTIONS: |
35 | - $USER | 35 | -s QUERY Search for a license matching QUERY. |
36 | -e EMAIL set AUTHOR's email address to EMAIL. | 36 | Only license titles are searched. |
37 | default: | 37 | |
38 | - git config --get user.email | 38 | -y YEARS Set copyright date(s) to YEARS. |
39 | - [blank] | 39 | Default: $(date +%Y). |
40 | -l LANG set license language to LANG. | 40 | -a AUTHORS Set copyright holder(s) to AUTHOR. |
41 | default: 'en' (subject to change) | 41 | Default: use the first of |
42 | -o FILE set output file to FILE. | 42 | - git config --get user.name |
43 | default: LICENSE in $PWD | 43 | - getent password $USER |
44 | parameters: | 44 | - $USER |
45 | LICENSE which license to use. | 45 | -e EMAILS Set AUTHOR's EMAIL address. |
46 | default: $LICENSER_LICENSE, which | 46 | Default: $(git config --get user.email), |
47 | defaults to MIT. | 47 | or stay blank. |
48 | -c COPYRIGHT Set the entire COPYRIGHT string to print. | ||
49 | By default, it's built from the above information: | ||
50 | "Copyright (C) <year> <author> <email>". | ||
51 | -w WIDTH Fold the output to WIDTH characters. | ||
52 | Default: 70. | ||
53 | -o FILE Output the fetched license to FILE. | ||
54 | Default: $PWD/COPYING. | ||
55 | |||
56 | PARAMETERS: | ||
57 | LICENSE The license to use. | ||
58 | Default: MIT. | ||
48 | ``` | 59 | ``` |
49 | 60 | ||
50 | ## License source | 61 | You can use an output file of `-` (i.e., `licensor -o-`) to print the license to |
62 | stdout. | ||
51 | 63 | ||
52 | As of v0.2, `licenser` gets its licenses from | 64 | ### Available licenses |
53 | [another repo](https://git.sr.ht/~acdw/licenser-licenses), | ||
54 | to streamline additions to available licenses. | ||
55 | If you have spotty internet connection or want to use your own license source, | ||
56 | you can change the environment variable `$LICENSER_SOURCE`. | ||
57 | 65 | ||
58 | For v0.3, I want to add a configuration file to take care of these kinds of | 66 | Licenses are pulled from [SPDX][]'s [git repository of licenses][spdx-git]. |
59 | configurations. | 67 | This includes all of the more common licenses, and honestly, if you're wanting |
68 | to do something weird is `licensor` the right project for you? | ||
60 | 69 | ||
61 | ## Contributing | 70 | *That being said, adding the ability for arbitrary license "repositories" is |
71 | probably for the best.* | ||
72 | |||
73 | [SPDX]: https://spdx.org/licenses/ | ||
74 | [spdx-git]: https://github.com/spdx/license-list-data/ | ||
75 | |||
76 | ### Templating | ||
77 | |||
78 | SPDX uses a [particular templating format][spdx-template-format] that `licensor` | ||
79 | can read and use. As of v1.0, only `beginOptional`/`endOptional` and | ||
80 | `var;name="copyright"` fields are filled in; all others are stripped from output. | ||
62 | 81 | ||
63 | Send me a request for another license or a pull-thingy | 82 | ## Configuring |
64 | through [the mailing list](~acdw/licenser@lists.sr.ht). | 83 | |
84 | There are some environment variables you can set to change `licensor`'s default | ||
85 | behavior: | ||
86 | |||
87 | - `LICENSE_REPO_VERSION` : 3.17 | ||
88 | - `LICENSE_REPO_URL` : `https://github.com/spdx/license-list-data/archive/refs/tags/v$LICENSE_REPO_VERSION.tar.gz` | ||
89 | - `LICENSE_REPO_PATH` : `license-list-data-$LICENSE_REPO_VERSION/template` | ||
90 | - `LICENSOR_LICENSE` : MIT | ||
91 | - `LICENSOR_OUTPUT_FILE` : COPYING | ||
92 | |||
93 | ## Contributing | ||
65 | 94 | ||
66 | Or, look at the [roadmap](https://todo.sr.ht/~acdw/licenser). | 95 | Send me an [email](mailto:acdw@acdw.net). |
67 | 96 | ||
68 | ## License | 97 | ## License |
69 | 98 | ||
70 | MIT, baby. | 99 | MIT, baby. |
71 | 100 | ||
101 | See [COPYING](/licensor/COPYING) for details. | ||
72 | 102 | ||
73 | ## Author | 103 | ## Author |
74 | 104 | ||