aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-03-25 17:42:11 -0300
committerEuAndreh <eu@euandre.org>2023-03-25 17:42:11 -0300
commitb63654a8620d4549d7676eef0ee7368e14be50af (patch)
tree3c61161d1b19bc337c30d27e8eac976291d0929b
parentbin/record-my-screen: Add working utility (diff)
downloaddotfiles-b63654a8620d4549d7676eef0ee7368e14be50af.tar.gz
dotfiles-b63654a8620d4549d7676eef0ee7368e14be50af.tar.xz
bin/aux: Allow files to be copied to be parameterized
-rwxr-xr-xbin/aux42
1 files 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