diff options
author | EuAndreh <eu@euandre.org> | 2023-03-25 17:42:11 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-03-25 17:42:11 -0300 |
commit | b63654a8620d4549d7676eef0ee7368e14be50af (patch) | |
tree | 3c61161d1b19bc337c30d27e8eac976291d0929b | |
parent | bin/record-my-screen: Add working utility (diff) | |
download | dotfiles-b63654a8620d4549d7676eef0ee7368e14be50af.tar.gz dotfiles-b63654a8620d4549d7676eef0ee7368e14be50af.tar.xz |
bin/aux: Allow files to be copied to be parameterized
-rwxr-xr-x | bin/aux | 42 |
1 files changed, 28 insertions, 14 deletions
@@ -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 |