diff --git a/Tests/ArgumentParserUnitTests/Snapshots/testBase_Zsh().sh b/Tests/ArgumentParserUnitTests/Snapshots/testBase_Zsh().sh deleted file mode 100644 index a2f42246c..000000000 --- a/Tests/ArgumentParserUnitTests/Snapshots/testBase_Zsh().sh +++ /dev/null @@ -1,84 +0,0 @@ -#compdef base-test -local context state state_descr line -_base_test_commandname=$words[1] -typeset -A opt_args - -_base-test() { - export SAP_SHELL=zsh - SAP_SHELL_VERSION="$(builtin emulate zsh -c 'printf %s "${ZSH_VERSION}"')" - export SAP_SHELL_VERSION - integer ret=1 - local -a args - args+=( - '--name[The user'"'"'s name.]:name:' - '--kind:kind:(one two custom-three)' - '--other-kind:other-kind:(1 2 3)' - '--path1:path1:_files' - '--path2:path2:_files' - '--path3:path3:(a b c)' - '--one' - '--two' - '--three' - '*--kind-counter' - '*--rep1:rep1:' - '*'{-r,--rep2}':rep2:' - ':argument:{_custom_completion $_base_test_commandname ---completion -- argument $words}' - ':nested-argument:{_custom_completion $_base_test_commandname ---completion -- nested.nestedArgument $words}' - '(-h --help)'{-h,--help}'[Show help information.]' - '(-): :->command' - '(-)*:: :->arg' - ) - _arguments -w -s -S $args[@] && ret=0 - case $state in - (command) - local subcommands - subcommands=( - 'sub-command:' - 'help:Show subcommand help information.' - ) - _describe "subcommand" subcommands - ;; - (arg) - case ${words[1]} in - (sub-command) - _base-test_sub-command - ;; - (help) - _base-test_help - ;; - esac - ;; - esac - - return ret -} - -_base-test_sub-command() { - integer ret=1 - local -a args - args+=( - '(-h --help)'{-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - -_base-test_help() { - integer ret=1 - local -a args - args+=( - ':subcommands:' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - - -_custom_completion() { - local completions=("${(@f)$($*)}") - _describe '' completions -} - -_base-test diff --git a/Tests/ArgumentParserUnitTests/Snapshots/testEscaped_Zsh().zsh b/Tests/ArgumentParserUnitTests/Snapshots/testEscaped_Zsh().zsh deleted file mode 100644 index e2c4846a9..000000000 --- a/Tests/ArgumentParserUnitTests/Snapshots/testEscaped_Zsh().zsh +++ /dev/null @@ -1,28 +0,0 @@ -#compdef escaped-command -local context state state_descr line -_escaped_command_commandname=$words[1] -typeset -A opt_args - -_escaped-command() { - export SAP_SHELL=zsh - SAP_SHELL_VERSION="$(builtin emulate zsh -c 'printf %s "${ZSH_VERSION}"')" - export SAP_SHELL_VERSION - integer ret=1 - local -a args - args+=( - '--one[Escaped chars: '"'"'\[\]\\.]:one:' - ':two:{_custom_completion $_escaped_command_commandname ---completion -- two $words}' - '(-h --help)'{-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - - -_custom_completion() { - local completions=("${(@f)$($*)}") - _describe '' completions -} - -_escaped-command diff --git a/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Bash().bash b/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Bash().bash deleted file mode 100644 index 07fa13631..000000000 --- a/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Bash().bash +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -_parent() { - export SAP_SHELL=bash - SAP_SHELL_VERSION="$(IFS='.'; printf %s "${BASH_VERSINFO[*]}")" - export SAP_SHELL_VERSION - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - COMPREPLY=() - opts="-h --help" - if [[ $COMP_CWORD == "1" ]]; then - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) - return - fi - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) -} - - -complete -F _parent parent diff --git a/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Fish().fish b/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Fish().fish deleted file mode 100644 index 64f75d940..000000000 --- a/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Fish().fish +++ /dev/null @@ -1,40 +0,0 @@ -# A function which filters options which starts with "-" from $argv. -function _swift_parent_preprocessor - set -l results - for i in (seq (count $argv)) - switch (echo $argv[$i] | string sub -l 1) - case '-' - case '*' - echo $argv[$i] - end - end -end - -function _swift_parent_using_command - set -gx SAP_SHELL fish - set -gx SAP_SHELL_VERSION "$FISH_VERSION" - set -l currentCommands (_swift_parent_preprocessor (commandline -opc)) - set -l expectedCommands (string split " " $argv[1]) - set -l subcommands (string split " " $argv[2]) - if [ (count $currentCommands) -ge (count $expectedCommands) ] - for i in (seq (count $expectedCommands)) - if [ $currentCommands[$i] != $expectedCommands[$i] ] - return 1 - end - end - if [ (count $currentCommands) -eq (count $expectedCommands) ] - return 0 - end - if [ (count $subcommands) -gt 1 ] - for i in (seq (count $subcommands)) - if [ $currentCommands[(math (count $expectedCommands) + 1)] = $subcommands[$i] ] - return 1 - end - end - end - return 0 - end - return 1 -end - -complete -c parent -n '_swift_parent_using_command "parent"' -s h -l help -d 'Show help information.' diff --git a/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Zsh().zsh b/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Zsh().zsh deleted file mode 100644 index 81e851c02..000000000 --- a/Tests/ArgumentParserUnitTests/Snapshots/testHiddenSubcommand_Zsh().zsh +++ /dev/null @@ -1,26 +0,0 @@ -#compdef parent -local context state state_descr line -_parent_commandname=$words[1] -typeset -A opt_args - -_parent() { - export SAP_SHELL=zsh - SAP_SHELL_VERSION="$(builtin emulate zsh -c 'printf %s "${ZSH_VERSION}"')" - export SAP_SHELL_VERSION - integer ret=1 - local -a args - args+=( - '(-h --help)'{-h,--help}'[Show help information.]' - ) - _arguments -w -s -S $args[@] && ret=0 - - return ret -} - - -_custom_completion() { - local completions=("${(@f)$($*)}") - _describe '' completions -} - -_parent