Helper for completion. Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> --- dim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dim b/dim index 6fb496ea4192..2f6e6151a4b2 100755 --- a/dim +++ b/dim @@ -1115,6 +1115,12 @@ function assert_branch fi } +# Note: used by bash completion +function dim_list_commands +{ + declare -F | grep -o " dim_[a-zA-Z_]*" | sed 's/^ dim_//;s/_/-/g' +} + function dim_alias { # use posix mode to omit functions in set output @@ -1178,7 +1184,7 @@ function dim_usage echo "usage: $0 [OPTIONS] SUBCOMMAND [ARGUMENTS]" echo echo "The available subcommands are:" - declare -F | grep -o " dim_[a-zA-Z_]*" | sed 's/^ dim_/\t/' + dim_list_commands | sed 's/^/\t/' echo echo "See '$0 help' for more information." } -- 2.1.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx