about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--LICENSE18
-rwxr-xr-xlicenser8
2 files changed, 21 insertions, 5 deletions
diff --git a/LICENSE b/LICENSE index f973b4b..44c8493 100644 --- a/LICENSE +++ b/LICENSE
@@ -1,7 +1,19 @@
1Copyright 2020 Case Duckworth 1Copyright 2020 Case Duckworth
2 2
3Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 3Permission is hereby granted, free of charge, to any person obtaining a copy
4of this software and associated documentation files (the "Software"), to deal
5in the Software without restriction, including without limitation the rights
6to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7copies of the Software, and to permit persons to whom the Software is
8furnished to do so, subject to the following conditions:
4 9
5The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 10The above copyright notice and this permission notice shall be included in all
11copies or substantial portions of the Software.
6 12
7THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 13THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19SOFTWARE.
diff --git a/licenser b/licenser index 2bca223..f3e5480 100755 --- a/licenser +++ b/licenser
@@ -7,7 +7,9 @@ __DEFAULT_LICENSE=MIT
7 7
8# entry point 8# entry point
9licenser() { 9licenser() {
10 while getopts hly:a:o: OPT; do 10 _force=false
11
12 while getopts hlfy:a:o: OPT; do
11 case "$OPT" in 13 case "$OPT" in
12 h) 14 h)
13 usage 15 usage
@@ -17,6 +19,7 @@ licenser() {
17 list_licenses 19 list_licenses
18 exit 0 20 exit 0
19 ;; 21 ;;
22 f) _force=true ;;
20 y) __YEAR="$OPTARG-01-01" ;; 23 y) __YEAR="$OPTARG-01-01" ;;
21 a) __AUTHOR="$OPTARG" ;; 24 a) __AUTHOR="$OPTARG" ;;
22 o) __OUTPUT="$OPTARG" ;; 25 o) __OUTPUT="$OPTARG" ;;
@@ -45,7 +48,7 @@ licenser() {
45 exit 2 48 exit 2
46 fi 49 fi
47 50
48 if [[ -e "$__OUTPUT" ]]; then 51 if [[ -e "$__OUTPUT" && ! $_force ]]; then
49 echo "File exists: $__OUTPUT" 52 echo "File exists: $__OUTPUT"
50 exit 3 53 exit 3
51 fi 54 fi
@@ -65,6 +68,7 @@ usage: licenser [-h|-l] [-y YEAR] [-a AUTHOR] [-o FILE] LICENSE
65 68
66 -h show this help and exit 69 -h show this help and exit
67 -l list available licenses and exit 70 -l list available licenses and exit
71 -f overwrite existing license
68 -y YEAR set the copyright date to YEAR 72 -y YEAR set the copyright date to YEAR
69 -a AUTHOR set the copyright holder to AUTHOR 73 -a AUTHOR set the copyright holder to AUTHOR
70 -o FILE output to FILE 74 -o FILE output to FILE