mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 09:24:19 +02:00
32 lines
664 B
Bash
Executable File
32 lines
664 B
Bash
Executable File
#!/bin/bash
|
|
|
|
getcommands() {
|
|
local command
|
|
command="$*"
|
|
|
|
if ! test "$command" = "help"; then
|
|
./esctl $command -h | sed -e '/^COMMANDS:/,/^$/!d;//d' -e 's/^ //' -e 's/[, ].*//' | sort
|
|
fi
|
|
}
|
|
|
|
printcommands() {
|
|
local indent basecommand commands command
|
|
indent="$1"
|
|
basecommand="$2"
|
|
commands="$3"
|
|
|
|
for command in $commands; do
|
|
echo "$indent" "$command"
|
|
|
|
commands=$(getcommands $basecommand $command)
|
|
|
|
if test -n "$commands"; then
|
|
printcommands "${indent} " "$basecommand $command" "$commands"
|
|
fi
|
|
done
|
|
}
|
|
|
|
|
|
commands=$(getcommands "")
|
|
printcommands "" "" "$commands"
|