Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unescaped chars appearing in zsh completion script #3295

Merged
merged 1 commit into from
Jan 16, 2022

Conversation

clifton
Copy link
Contributor

@clifton clifton commented Jan 15, 2022

  • tests pass, but zsh generated is invalid.
  • fixed
> my_app <tab>
_my_app:40: parse error near `;;'

invalid zsh (see line: ::file -- some input's file:_files'):

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'::file -- some input's file:_files' \
":: :_myapp_commands" \
"*::: :->myapp" \
&& ret=0
    case $state in
    (myapp)
        words=($line[2] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:myapp-command-$line[2]:"
        case $line[2] in
            (test)
_arguments "${_arguments_options[@]}" \
'--case=[test'\''s cases to test]: : ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \

@clifton clifton marked this pull request as draft January 15, 2022 19:50
@clifton clifton changed the title bug: unescaped chars appearing in zsh completion script fix: unescaped chars appearing in zsh completion script Jan 15, 2022
@clifton clifton marked this pull request as ready for review January 15, 2022 20:16
clifton added a commit to clifton/foundry that referenced this pull request Jan 15, 2022
@clifton clifton force-pushed the zsh-about-unescaped branch 2 times, most recently from 8b26658 to eafe28e Compare January 15, 2022 20:30
help strings for subcomand args did not escape single quotes
gakonst added a commit to foundry-rs/foundry that referenced this pull request Jan 15, 2022
* fix cast autocompletion

re: clap-rs/clap#3295

* Update cli/src/opts/cast.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
@epage
Copy link
Member

epage commented Jan 16, 2022

Thanks!

@epage epage merged commit 277075d into clap-rs:master Jan 16, 2022
@epage
Copy link
Member

epage commented Jan 16, 2022

v3.0.4 is released.

charisma98 added a commit to charisma98/foundry that referenced this pull request Mar 4, 2023
* fix cast autocompletion

re: clap-rs/clap#3295

* Update cli/src/opts/cast.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
0129general added a commit to 0129general/FoundryProject that referenced this pull request May 8, 2024
* fix cast autocompletion

re: clap-rs/clap#3295

* Update cli/src/opts/cast.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants