diff options
author | EuAndreh <eu@euandre.org> | 2023-04-06 15:54:57 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2023-04-06 15:54:57 -0300 |
commit | 5d72183ec12014349285dd9d221e355a88bf385c (patch) | |
tree | c87618760a41bb41c3fcf9185e7fd59a2f3f43ca /bin | |
parent | aux/po4a-cfg.sh: Include whatever is given via STDIN (diff) | |
download | dotfiles-5d72183ec12014349285dd9d221e355a88bf385c.tar.gz dotfiles-5d72183ec12014349285dd9d221e355a88bf385c.tar.xz |
bin/aux: Recover [FILE...] argument handling
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/aux | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -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 |