-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Completions): adds the ability to generate completions to io::Wr…
…ite object
- v4.5.27
- v4.5.26
- v4.5.25
- v4.5.24
- v4.5.23
- v4.5.22
- v4.5.21
- v4.5.20
- v4.5.19
- v4.5.18
- v4.5.17
- v4.5.16
- v4.5.15
- v4.5.14
- v4.5.13
- v4.5.12
- v4.5.11
- v4.5.10
- v4.5.9
- v4.5.8
- v4.5.7
- v4.5.6
- v4.5.5
- v4.5.4
- v4.5.3
- v4.5.2
- v4.5.1
- v4.5.0
- v4.4.18
- v4.4.17
- v4.4.16
- v4.4.15
- v4.4.14
- v4.4.13
- v4.4.12
- v4.4.11
- v4.4.10
- v4.4.9
- v4.4.8
- v4.4.7
- v4.4.6
- v4.4.5
- v4.4.4
- v4.4.3
- v4.4.2
- v4.4.1
- v4.4.0
- v4.3.24
- v4.3.23
- v4.3.22
- v4.3.21
- v4.3.20
- v4.3.19
- v4.3.18
- v4.3.17
- v4.3.16
- v4.3.15
- v4.3.14
- v4.3.13
- v4.3.12
- v4.3.11
- v4.3.10
- v4.3.9
- v4.3.8
- v4.3.7
- v4.3.6
- v4.3.5
- v4.3.4
- v4.3.3
- v4.3.2
- v4.3.1
- v4.3.0
- v4.2.7
- v4.2.6
- v4.2.5
- v4.2.4
- v4.2.3
- v4.2.2
- v4.2.1
- v4.2.0
- v4.1.14
- v4.1.13
- v4.1.12
- v4.1.11
- v4.1.10
- v4.1.9
- v4.1.8
- v4.1.7
- v4.1.6
- v4.1.5
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.32
- v4.0.31
- v4.0.30
- v4.0.29
- v4.0.28
- v4.0.27
- v4.0.26
- v4.0.25
- v4.0.24
- v4.0.23
- v4.0.22
- v4.0.21
- v4.0.20
- v4.0.19
- v4.0.18
- v4.0.17
- v4.0.16
- v4.0.15
- v4.0.14
- v4.0.13
- v4.0.12
- v4.0.11
- v4.0.10
- v4.0.9
- v4.0.8
- v4.0.7
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v4.0.0-rc.3
- v4.0.0-rc.2
- v4.0.0-rc.1
- v3.2.25
- v3.2.24
- v3.2.23
- v3.2.22
- v3.2.21
- v3.2.20
- v3.2.19
- v3.2.18
- v3.2.17
- v3.2.16
- v3.2.15
- v3.2.14
- v3.2.13
- v3.2.12
- v3.2.11
- v3.2.10
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.18
- v3.1.17
- v3.1.16
- v3.1.15
- v3.1.14
- v3.1.13
- v3.1.12
- v3.1.11
- v3.1.10
- v3.1.9
- v3.1.8
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.14
- v3.0.13
- v3.0.12
- v3.0.11
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-rc.13
- v3.0.0-rc.12
- v3.0.0-rc.11
- v3.0.0-rc.10
- v3.0.0-rc.9
- v3.0.0-rc.8
- v3.0.0-rc.7
- v3.0.0-rc.6
- v3.0.0-rc.5
- v3.0.0-rc.4
- v3.0.0-rc.3
- v3.0.0-rc.2
- v3.0.0-rc.1
- v3.0.0-rc.0
- v3.0.0-beta.5
- v3.0.0-beta.4
- v3.0.0-beta.2
- v3.0.0-beta.1
- v2.34.0
- v2.33.4
- v2.33.3
- v2.33.2
- v2.33.1
- v2.33.0
- v2.32.0
- v2.31.2
- v2.30.0
- v2.29.3
- v2.29.1
- v2.26.1
- v2.24.1
- v2.23.1
- v2.22.1
- v2.21.2
- v2.21.1
- v2.20.3
- v2.20.0
- v2.19.2
- v2.19.1
- v2.19.0
- v2.18.0
- v2.17.0
- v2.16.4
- v2.16.2
- v2.15.0
- v2.14.1
- v2.14.0
- v2.12.1
- v2.12.0
- v2.11.2
- v2.11.0
- v2.10.4
- v2.10.1
- v2.10.0
- v2.9.3
- clap_mangen-v0.2.26
- clap_mangen-v0.2.25
- clap_mangen-v0.2.24
- clap_mangen-v0.2.23
- clap_mangen-v0.2.22
- clap_mangen-v0.2.21
- clap_mangen-v0.2.20
- clap_mangen-v0.2.19
- clap_mangen-v0.2.18
- clap_mangen-v0.2.17
- clap_mangen-v0.2.16
- clap_mangen-v0.2.15
- clap_mangen-v0.2.14
- clap_mangen-v0.2.13
- clap_mangen-v0.2.12
- clap_mangen-v0.2.11
- clap_mangen-v0.2.10
- clap_mangen-v0.2.9
- clap_mangen-v0.2.8
- clap_mangen-v0.2.7
- clap_mangen-v0.2.6
- clap_mangen-v0.2.5
- clap_mangen-v0.2.4
- clap_mangen-v0.2.3
- clap_mangen-v0.2.2
- clap_mangen-v0.2.1
- clap_mangen-v0.2.0
- clap_mangen-v0.2.0-rc.1
- clap_mangen-v0.1.11
- clap_mangen-v0.1.10
- clap_mangen-v0.1.9
- clap_mangen-v0.1.8
- clap_mangen-v0.1.7
- clap_mangen-v0.1.6
- clap_mangen-v0.1.5
- clap_mangen-v0.1.4
- clap_mangen-v0.1.3
- clap_mangen-v0.1.2
- clap_mangen-v0.1.1
- clap_mangen-v0.1.0
- clap_lex-v0.7.4
- clap_lex-v0.7.3
- clap_lex-v0.7.2
- clap_lex-v0.7.1
- clap_lex-v0.7.0
- clap_lex-v0.6.0
- clap_lex-v0.5.1
- clap_lex-v0.5.0
- clap_lex-v0.4.1
- clap_lex-v0.4.0
- clap_lex-v0.3.3
- clap_lex-v0.3.2
- clap_lex-v0.3.1
- clap_lex-v0.3.0
- clap_lex-v0.2.4
- clap_lex-v0.2.3
- clap_lex-v0.2.2
- clap_lex-v0.2.1
- clap_lex-v0.2.0
- clap_lex-v0.1.1
- clap_lex-v0.1.0
- clap_generate-v3.0.3
- clap_generate-v3.0.2
- clap_generate-v3.0.1
- clap_generate-v3.0.0
- clap_generate-v3.0.0-rc.13
- clap_generate-v3.0.0-rc.12
- clap_generate-v3.0.0-rc.11
- clap_generate-v3.0.0-rc.10
- clap_generate-v3.0.0-rc.9
- clap_generate-v3.0.0-rc.8
- clap_generate-v3.0.0-rc.7
- clap_generate-v3.0.0-rc.6
- clap_generate-v3.0.0-rc.5
- clap_generate-v3.0.0-rc.4
- clap_generate-v3.0.0-rc.3
- clap_generate-v3.0.0-rc.1
- clap_generate-v3.0.0-rc.0
- clap_generate_fig-v3.0.1
- clap_generate_fig-v3.0.0
- clap_generate_fig-v3.0.0-rc.13
- clap_generate_fig-v3.0.0-rc.12
- clap_generate_fig-v3.0.0-rc.11
- clap_generate_fig-v3.0.0-rc.10
- clap_generate_fig-v3.0.0-rc.9
- clap_generate_fig-v3.0.0-rc.8
- clap_generate_fig-v3.0.0-rc.7
- clap_generate_fig-v3.0.0-rc.6
- clap_generate_fig-v3.0.0-rc.5
- clap_generate_fig-v3.0.0-rc.4
- clap_generate_fig-v3.0.0-rc.3
- clap_generate_fig-v3.0.0-rc.1
- clap_complete-v4.5.43
- clap_complete-v4.5.42
- clap_complete-v4.5.41
- clap_complete-v4.5.40
- clap_complete-v4.5.39
- clap_complete-v4.5.38
- clap_complete-v4.5.37
- clap_complete-v4.5.36
- clap_complete-v4.5.35
- clap_complete-v4.5.34
- clap_complete-v4.5.33
- clap_complete-v4.5.32
- clap_complete-v4.5.30
- clap_complete-v4.5.29
- clap_complete-v4.5.28
- clap_complete-v4.5.27
- clap_complete-v4.5.26
- clap_complete-v4.5.25
- clap_complete-v4.5.24
- clap_complete-v4.5.23
- clap_complete-v4.5.22
- clap_complete-v4.5.21
- clap_complete-v4.5.20
- clap_complete-v4.5.19
- clap_complete-v4.5.18
- clap_complete-v4.5.17
- clap_complete-v4.5.16
- clap_complete-v4.5.15
- clap_complete-v4.5.14
- clap_complete-v4.5.13
- clap_complete-v4.5.12
- clap_complete-v4.5.11
- clap_complete-v4.5.10
- clap_complete-v4.5.9
- clap_complete-v4.5.8
- clap_complete-v4.5.7
- clap_complete-v4.5.6
- clap_complete-v4.5.5
- clap_complete-v4.5.4
- clap_complete-v4.5.3
- clap_complete-v4.5.2
- clap_complete-v4.5.1
- clap_complete-v4.5.0
- clap_complete-v4.4.10
- clap_complete-v4.4.9
- clap_complete-v4.4.8
- clap_complete-v4.4.7
- clap_complete-v4.4.6
- clap_complete-v4.4.5
- clap_complete-v4.4.4
- clap_complete-v4.4.3
- clap_complete-v4.4.2
- clap_complete-v4.4.1
- clap_complete-v4.4.0
- clap_complete-v4.3.2
- clap_complete-v4.3.1
- clap_complete-v4.3.0
- clap_complete-v4.2.3
- clap_complete-v4.2.2
- clap_complete-v4.2.1
- clap_complete-v4.2.0
- clap_complete-v4.1.6
- clap_complete-v4.1.5
- clap_complete-v4.1.4
- clap_complete-v4.1.3
- clap_complete-v4.1.2
- clap_complete-v4.1.1
- clap_complete-v4.1.0
- clap_complete-v4.0.7
- clap_complete-v4.0.6
- clap_complete-v4.0.5
- clap_complete-v4.0.4
- clap_complete-v4.0.3
- clap_complete-v4.0.2
- clap_complete-v4.0.1
- clap_complete-v4.0.0
- clap_complete-v4.0.0-rc.1
- clap_complete-v3.2.5
- clap_complete-v3.2.4
- clap_complete-v3.2.3
- clap_complete-v3.2.2
- clap_complete-v3.2.1
- clap_complete-v3.2.0
- clap_complete-v3.1.4
- clap_complete-v3.1.3
- clap_complete-v3.1.2
- clap_complete-v3.1.1
- clap_complete-v3.1.0
- clap_complete-v3.0.6
- clap_complete-v3.0.5
- clap_complete-v3.0.4
- clap_complete-v3.0.3
- clap_complete-v3.0.2
- clap_complete-v3.0.1
- clap_complete-v3.0.0
- clap_complete-v3.0.0-rc.13
- clap_complete-v3.0.0-rc.12
- clap_complete_nushell-v4.5.5
- clap_complete_nushell-v4.5.4
- clap_complete_nushell-v4.5.3
- clap_complete_nushell-v4.5.2
- clap_complete_nushell-v4.5.1
- clap_complete_nushell-v4.5.0
- clap_complete_nushell-v4.4.2
- clap_complete_nushell-v4.4.1
- clap_complete_nushell-v4.4.0
- clap_complete_nushell-v4.3.2
- clap_complete_nushell-v4.3.1
- clap_complete_nushell-v4.3.0
- clap_complete_fig-v4.5.2
- clap_complete_fig-v4.5.1
- clap_complete_fig-v4.5.0
- clap_complete_fig-v4.4.2
- clap_complete_fig-v4.4.1
- clap_complete_fig-v4.4.0
- clap_complete_fig-v4.3.1
- clap_complete_fig-v4.3.0
- clap_complete_fig-v4.2.0
- clap_complete_fig-v4.1.2
- clap_complete_fig-v4.1.1
- clap_complete_fig-v4.1.0
- clap_complete_fig-v4.0.2
- clap_complete_fig-v4.0.1
- clap_complete_fig-v4.0.0
- clap_complete_fig-v4.0.0-rc.1
- clap_complete_fig-v3.2.4
- clap_complete_fig-v3.2.3
- clap_complete_fig-v3.2.2
- clap_complete_fig-v3.2.1
- clap_complete_fig-v3.2.0
- clap_complete_fig-v3.1.5
- clap_complete_fig-v3.1.4
- clap_complete_fig-v3.1.3
- clap_complete_fig-v3.1.2
- clap_complete_fig-v3.1.1
- clap_complete_fig-v3.1.0
- clap_complete_fig-v3.0.2
- clap_complete_fig-v3.0.1
- clap_complete_fig-v3.0.0
- clap_complete_fig-v3.0.0-rc.13
- clap_complete_fig-v3.0.0-rc.12
- 2.27.0
1 parent
691ef58
commit 9f62cf7
Showing
4 changed files
with
90 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
extern crate clap; | ||
|
||
use clap::{App, Arg, SubCommand, Shell}; | ||
|
||
#[test] | ||
fn test_generation() { | ||
let mut app = App::new("myapp") | ||
.about("Tests completions") | ||
.arg(Arg::with_name("file") | ||
.help("some input file")) | ||
.subcommand(SubCommand::with_name("test") | ||
.about("tests things") | ||
.arg(Arg::with_name("case") | ||
.long("case") | ||
.takes_value(true) | ||
.help("the case to test"))); | ||
let mut buf = vec![]; | ||
app.gen_completions_to("myapp", Shell::Bash, &mut buf); | ||
let string = String::from_utf8(buf).unwrap(); | ||
let first_line = string.lines().nth(0).unwrap(); | ||
let last_line = string.lines().rev().nth(0).unwrap(); | ||
|
||
assert_eq!(first_line, "_myapp() {"); | ||
assert_eq!(last_line, "complete -F _myapp myapp"); | ||
} |