From b63654a8620d4549d7676eef0ee7368e14be50af Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 25 Mar 2023 17:42:11 -0300 Subject: bin/aux: Allow files to be copied to be parameterized --- bin/aux | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/bin/aux b/bin/aux index e51cfe8..b6509d3 100755 --- a/bin/aux +++ b/bin/aux @@ -5,7 +5,7 @@ set -eu usage() { cat <<-'EOF' Usage: - aux + aux [FILE...] aux -h EOF } @@ -18,14 +18,20 @@ help() { -h, --help show this message - Hydrate software project with auxiliary files. + Hydrate software project with auxiliary files. If FILE is + given, restrict effect to those paths. Examples: - Just run it: + Just run it with default values: $ aux + + + Get only the "tests/assert-shellcheck.sh" file: + + $ aux tests/assert-shellcheck.sh EOF } @@ -69,14 +75,22 @@ cp_all() { done } -cp_all \ - aux/.gitignore \ - aux/lib.sh \ - aux/tld.txt \ - aux/workflow/favicon.svg \ - aux/workflow/head.html \ - aux/workflow/md2html.sh \ - aux/workflow/style.css \ - aux/workflow/preamble.md.in \ - aux/workflow/TODOs.sh \ - aux/ci/report.sh \ +FILES=' +aux/.gitignore +aux/lib.sh +aux/tld.txt +aux/workflow/favicon.svg +aux/workflow/head.html +aux/workflow/md2html.sh +aux/workflow/style.css +aux/workflow/preamble.md.in +aux/workflow/TODOs.sh +aux/ci/report.sh +' + +if [ $# = 0 ]; then + # shellcheck disable=2086 + cp_all $FILES +else + cp_all "$@" +fi -- cgit v1.2.3