From 8e9dadfaad19d71d6901dd76013bc27607235645 Mon Sep 17 00:00:00 2001 From: David Farrell Date: Tue, 10 Mar 2020 22:58:39 -0700 Subject: [PATCH] Adds metadata + support for multiple arguments --- plugins/available/cht-sh.plugin.bash | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/available/cht-sh.plugin.bash b/plugins/available/cht-sh.plugin.bash index bc9dcd6c..92846989 100644 --- a/plugins/available/cht-sh.plugin.bash +++ b/plugins/available/cht-sh.plugin.bash @@ -4,6 +4,17 @@ about-plugin 'Simplify `curl cht.sh/` to `cht.sh `' # Play nicely if user already installed cht.sh cli tool if ! _command_exists cht.sh ; then function cht.sh () { - curl "cht.sh/$1" + about 'Executes a cht.sh curl query using the provided arguments' + param ' [ ( topic [sub-topic] ) | ~keyword ] [ :list | :help | :learn ]' + example '$ cht.sh :help' + example '$ cht.sh :list' + example '$ cht.sh tar' + example '$ cht.sh js "parse json"' + example '$ cht.sh python :learn' + example '$ cht.sh rust :list' + group 'cht-sh' + + local query=$(IFS=/ ; echo "$*") + curl "cht.sh/${query}" } fi