diff options
author | Case Duckworth | 2022-07-08 22:54:42 -0500 |
---|---|---|
committer | Case Duckworth | 2022-07-08 22:54:42 -0500 |
commit | bfd5e92ee58da955c9a6f32c4f60500fbf9bdc24 (patch) | |
tree | 9856fbfdc8893be00fc43a49a48a2d2760a20b8e | |
parent | Refactor license_convert (diff) | |
download | licensor-master.tar.gz licensor-master.zip |
Fix -r flag master
-rwxr-xr-x | licensor | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/licensor b/licensor index 3e0e065..5d46823 100755 --- a/licensor +++ b/licensor | |||
@@ -13,7 +13,8 @@ LICENSOR_CACHE="${XDG_CACHE_HOME:-$HOME/.cache}/licensor" | |||
13 | usage() { | 13 | usage() { |
14 | cat <<EOF | 14 | cat <<EOF |
15 | $PRGN: easily provide a license for a project | 15 | $PRGN: easily provide a license for a project |
16 | USAGE: $PRGN [-h|-l|-L] | 16 | USAGE: $PRGN -h |
17 | $PRGN [-l|-L] | ||
17 | $PRGN -s QUERY | 18 | $PRGN -s QUERY |
18 | $PRGN [FLAGS] [OPTIONS] [LICENSE] | 19 | $PRGN [FLAGS] [OPTIONS] [LICENSE] |
19 | 20 | ||
@@ -22,6 +23,7 @@ FLAGS: | |||
22 | -l List available licenses and exit. | 23 | -l List available licenses and exit. |
23 | -L List available licenses, disregarding cache. | 24 | -L List available licenses, disregarding cache. |
24 | This flag will re-download the license repo. | 25 | This flag will re-download the license repo. |
26 | -r Output the raw license file specified by LICENSE. | ||
25 | 27 | ||
26 | -f Overwrite existing license. | 28 | -f Overwrite existing license. |
27 | -q Be quiet (don't log anything). | 29 | -q Be quiet (don't log anything). |
@@ -71,14 +73,14 @@ main() { | |||
71 | __email="$(guess_email)" | 73 | __email="$(guess_email)" |
72 | _converter=license_convert | 74 | _converter=license_convert |
73 | 75 | ||
74 | while getopts hlLs:fzZpPqy:a:e:o:w:c: opt; do | 76 | while getopts hlLrs:fzZpPqy:a:e:o:w:c: opt; do |
75 | case "$opt" in | 77 | case "$opt" in |
76 | # commands | 78 | # commands |
77 | h) usage ;; | 79 | h) usage ;; |
78 | l) list_licenses && exit || exit $? ;; | 80 | l) list_licenses && exit || exit $? ;; |
79 | L) list_licenses -f && exit || exit $? ;; | 81 | L) list_licenses -f && exit || exit $? ;; |
82 | r) _converter=lcat ;; | ||
80 | s) search_licenses "$OPTARG" ;; | 83 | s) search_licenses "$OPTARG" ;; |
81 | c) _converter=lcat ;; | ||
82 | # flags | 84 | # flags |
83 | f) _force=true ;; | 85 | f) _force=true ;; |
84 | z) _fold=1 ;; | 86 | z) _fold=1 ;; |
@@ -120,7 +122,7 @@ main() { | |||
120 | 122 | ||
121 | lcat() { | 123 | lcat() { |
122 | set -- | 124 | set -- |
123 | cat - | 125 | cat |
124 | } | 126 | } |
125 | 127 | ||
126 | get_licenses() { | 128 | get_licenses() { |