From 5d72183ec12014349285dd9d221e355a88bf385c Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Thu, 6 Apr 2023 15:54:57 -0300 Subject: bin/aux: Recover [FILE...] argument handling --- bin/aux | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'bin/aux') diff --git a/bin/aux b/bin/aux index 93952b9..e092b1f 100755 --- a/bin/aux +++ b/bin/aux @@ -95,9 +95,18 @@ cp_empty() { fi } -for d in "$D"/cases/*/; do - fn="$(basename "$d")" - find "$d" -not -type d | while read -r f; do - "$fn" "$f" "${f#"$D/cases/$fn/"}" + +if [ $# = 0 ]; then + for d in "$D"/cases/*/; do + fn="$(basename "$d")" + find "$d" -not -type d | while read -r f; do + "$fn" "$f" "${f#"$D/cases/$fn/"}" + done done -done +else + for to in "$@"; do + find "$D" -not -type d | grep "$to"$ | while read -r from; do + cp_all "$from" "$to" + done + done +fi -- cgit v1.2.3