Skip to content

Commit

Permalink
chore: update completions
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloso committed Mar 21, 2023
1 parent 8e972ce commit 776d327
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion completions/pomsky.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ _complete_pomsky()
local warnings="0 compat=0 deprecated=0"
local warnings_concat="-W0 -Wcompat=0 -Wdeprecated=0"
local features="atomic-groups boundaries dot grapheme lazy-mode lookahead lookbehind named-groups numbered-groups ranges references regexes variables"
local flags="--allowed-features --flavor --help --no-new-line --path --version --warnings --debug --json"
local flags="--allowed-features --flavor --help --no-new-line --path --version --warnings --debug --json --list"

local cur=${COMP_WORDS[COMP_CWORD]}
local prev=${COMP_WORDS[COMP_CWORD - 1]}
Expand All @@ -27,6 +27,9 @@ _complete_pomsky()
-f | --flavor)
COMPREPLY=( $( compgen -W "$flavors" -- $cur ) )
;;
--list)
COMPREPLY=( $( compgen -W "shorthands" -- $cur ) )
;;
-W | --warnings)
COMPREPLY=( $( compgen -W "$warnings" -- $cur ) )
;;
Expand Down
1 change: 1 addition & 0 deletions completions/pomsky.fish
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ deprecated=0 Disable deprecation warnings'
complete -c pomsky -l allowed-features -d 'Allowed features, comma-separated' -xa "(__fish_append , $features)"
complete -c pomsky -s f -l flavor -d 'Regex flavor' -xa "(echo \"$flavors\")"
complete -c pomsky -s h -l help -d 'Show help information'
complete -c pomsky -l list -d 'List shorthands' -xa "shorthands"
complete -c pomsky -s n -l no-new-line -d "Don't print line break after the output"
complete -c pomsky -s p -l path -d 'File to compile' -kxa "(__fish_complete_suffix .pom)"
complete -c pomsky -s V -l version -d 'Print version information'
Expand Down
9 changes: 9 additions & 0 deletions completions/pomsky.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ _pomsky_complete_features() {
_values -s , 'features' ascii-mode atomic-groups boundaries dot grapheme lazy-mode lookahead lookbehind named-groups numbered-groups ranges references regexes variables
}

_pomsky_complete_lists() {
lists=(
'shorthands:Unicode properties and shorthands'
)
_describe -t lists 'lists' lists
}

_pomsky_complete_flavor() {
flavors=(
'pcre:PCRE flavor'
Expand Down Expand Up @@ -33,6 +40,7 @@ _pomsky() {
'(--allowed-features)--allowed-features=[Allowed features, comma-separated]: :->features' \
'(-f --flavor)'{-f+,--flavor=}'[Regex flavor]: :->flavor' \
'(-h --help)'{-h+,--help=}'[Show help information]' \
'(--list)--list=[List shorthands]: :->lists' \
'(-n --no-new-line)'{-n,--no-new-line}"[Don't print line break after the output]" \
'(-p --path)'{-p+,--path=}'[File to compile]: :->path' \
'(-V --version)'{-V,--version}'[Print version information]' \
Expand All @@ -46,6 +54,7 @@ _pomsky() {
(flavor) _pomsky_complete_flavor ;;
(path) _pomsky_complete_path ;;
(warnings) _pomsky_complete_warnings ;;
(lists) _pomsky_complete_lists ;;
(*) ;;
esac
}
Expand Down

0 comments on commit 776d327

Please sign in to comment.