From 1c4c1c3faf8ba1240cd779d13be1d30ce32650b1 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Sun, 29 Mar 2020 21:04:44 +0400 Subject: [PATCH] =?UTF-8?q?dmctl:=20l'option=20-a=20supporte=20les=20r?= =?UTF-8?q?=C3=A9pertoires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dmctl | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/dmctl b/dmctl index 6395a06..059fb39 100755 --- a/dmctl +++ b/dmctl @@ -8,6 +8,7 @@ function display_help() { USAGE $scriptname -d NAME $scriptname -l ARCHIVE + $scriptname -a ARCHIVEs... OPTIONS -d, --dump @@ -131,12 +132,17 @@ case "$action" in dump) dump_machine "$1";; load) load_machine "$1";; loadall) - if [ $# -gt 0 ]; then - archives=("$@") - else - NOCLOBBER=1 - array_lsfiles archives . "*-machine.tar.gz" - fi + [ $# -gt 0 ] || set -- . + archives=() + for file in "$@"; do + if [ -d "$file" ]; then + NOCLOBBER=1 + array_lsfiles files "$file" "*-machine.tar.gz" + array_extend archives files + else + archives+=("$file") + fi + done for archive in "${archives[@]}"; do etitle "$archive" load_machine "$archive"