summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2015-06-06 11:30:18 +0200
committerMatthias Beyer <mail@beyermatthias.de>2015-09-07 14:34:36 +0200
commit6b5bc28848d56b96d228fb58bd515003c8c61c15 (patch)
tree1adbede40faf245515c4afbb2b63649b29162951
parent254fa074c14766be46187ff663a536fe63adca7f (diff)
Add util for listing all subcommands for a caller
-rw-r--r--nix-utils.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/nix-utils.sh b/nix-utils.sh
index c5dd151..ba5720d 100644
--- a/nix-utils.sh
+++ b/nix-utils.sh
@@ -137,3 +137,11 @@ caller_util_all_commands() {
find $(dirname ${BASH_SOURCE[0]}) -type f -name "${1}-*.sh"
}
+# Argument 1: Caller script name, format: "nix-script"
+caller_util_list_subcommands_for() {
+ for cmd in $(caller_util_all_commands $1)
+ do
+ scriptname_to_command "$cmd" "$1"
+ done
+}
+