From e13268153f113d03b890e2077606ee362907ff1e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 8 Jul 2022 22:41:10 -0500 Subject: Allow for simple catting of a license --- licensor | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/licensor b/licensor index b5795ae..5e784bb 100755 --- a/licensor +++ b/licensor @@ -69,6 +69,7 @@ main() { __year="$(date +%Y)" __author="$(guess_author)" __email="$(guess_email)" + _converter=license_convert while getopts hlLs:fzZpPqy:a:e:o:w:c: opt; do case "$opt" in @@ -77,6 +78,7 @@ main() { l) list_licenses && exit || exit $? ;; L) list_licenses -f && exit || exit $? ;; s) search_licenses "$OPTARG" ;; + c) _converter=lcat ;; # flags f) _force=true ;; z) _fold=1 ;; @@ -111,11 +113,16 @@ main() { fi license_file="$(get_license "$__license")" || exit $? - license_convert <"$LICENSOR_CACHE/$license_file.template.txt" \ + $_converter <"$LICENSOR_CACHE/$license_file.template.txt" \ "$__copyright" "$_optional" "$_fold" "$__width" >"$__output" [ "$__output" != /dev/stdout ] && log "$__license license written to $__output." } +lcat() { + set -- + cat - +} + get_licenses() { # Get licenses from cache, or download them if ! [ -d "$LICENSOR_CACHE" ] || [ "x$1" = "x-f" ]; then -- cgit 1.4.1-21-gabe81