Skip to content

Commit

Permalink
Merge pull request #3275 from xylous/master
Browse files Browse the repository at this point in the history
fix(complete): add newline at end of zsh output
  • Loading branch information
epage committed Jan 10, 2022
2 parents c5ace9a + e2f4d28 commit b9a1876
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
3 changes: 2 additions & 1 deletion clap_complete/src/shells/zsh.rs
Expand Up @@ -39,7 +39,8 @@ _{name}() {{
{subcommand_details}
_{name} \"$@\"",
_{name} \"$@\"
",
name = app.get_bin_name().unwrap(),
initial_args = get_args_of(app, None),
subcommands = get_subcommands_of(app),
Expand Down
18 changes: 12 additions & 6 deletions clap_complete/tests/completions/zsh.rs
Expand Up @@ -98,7 +98,8 @@ _myapp__test_commands() {
_describe -t commands 'myapp test commands' commands "$@"
}
_myapp "$@""#;
_myapp "$@"
"#;

#[test]
fn zsh_with_special_commands() {
Expand Down Expand Up @@ -234,7 +235,8 @@ _my_app__test_commands() {
_describe -t commands 'my_app test commands' commands "$@"
}
_my_app "$@""#;
_my_app "$@"
"#;

#[test]
fn zsh_with_special_help() {
Expand Down Expand Up @@ -309,7 +311,8 @@ _my_app_commands() {
_describe -t commands 'my_app commands' commands "$@"
}
_my_app "$@""#;
_my_app "$@"
"#;

#[test]
fn zsh_with_nested_subcommands() {
Expand Down Expand Up @@ -426,7 +429,8 @@ _my_app__second__third_commands() {
_describe -t commands 'my_app second third commands' commands "$@"
}
_my_app "$@""#;
_my_app "$@"
"#;

#[test]
fn zsh_with_aliases() {
Expand Down Expand Up @@ -497,7 +501,8 @@ _cmd_commands() {
_describe -t commands 'cmd commands' commands "$@"
}
_cmd "$@""#;
_cmd "$@"
"#;

#[test]
fn zsh_with_files_and_dirs() {
Expand Down Expand Up @@ -559,4 +564,5 @@ _my_app_commands() {
_describe -t commands 'my_app commands' commands "$@"
}
_my_app "$@""#;
_my_app "$@"
"#;
3 changes: 2 additions & 1 deletion clap_complete/tests/value_hints.rs
Expand Up @@ -128,7 +128,8 @@ _my_app_commands() {
_describe -t commands 'my_app commands' commands "$@"
}
_my_app "$@""#;
_my_app "$@"
"#;

static FISH_VALUE_HINTS: &str = r#"complete -c my_app -l choice -r -f -a "{bash ,fish ,zsh }"
complete -c my_app -l unknown -r
Expand Down

0 comments on commit b9a1876

Please sign in to comment.