Add url command to {en,de}code text

This commit is contained in:
2023-10-19 17:42:00 +01:00
parent 5c62ff219c
commit 4b0425b2d4
3 changed files with 50 additions and 1 deletions

22
url/_url Normal file
View File

@@ -0,0 +1,22 @@
#compdef url
_url() {
local ret=1 context curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C -w -s \
'(-h --help)'{-h,--help}'[show this help message and exit]' \
'1: :->command'
case $state in
(command)
declare -a commands
local commands=(
encode:'encode unencoded text'
decode:'decode encoded text'
)
_describe -t commands command commands && ret=0 ;;
esac
return ret
}