mirror of
https://github.com/rancher/os.git
synced 2025-04-28 11:24:26 +00:00
24 lines
434 B
Bash
Executable File
24 lines
434 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
is_not_a_valid() {
|
|
local target=$1
|
|
[ ! -x "$target" ] || [ ! -f "$target" ]
|
|
}
|
|
|
|
get_help_statement_for() {
|
|
local target=$1
|
|
grep '^# help:' $target | sed 's/# help://'
|
|
}
|
|
|
|
cd $(dirname $0)
|
|
echo "Targets:"
|
|
|
|
for target in *; do
|
|
is_not_a_valid $target && continue
|
|
help_statement=$(get_help_statement_for $target)
|
|
if [ -n "$help_statement" ]; then
|
|
echo -e " $target: $help_statement"
|
|
fi
|
|
done
|
|
|