Commit graph

1494 commits

Author SHA1 Message Date
Homu
098d7faa2c Auto merge of #620 - kbknapp:issue-614, r=kbknapp
feat(YAML): allows using lists or single values with arg declarations

One can now use a list or single value for certain Arg YAML declarations
such as possible_values, etc.

Prior to this commit, if only a single value was desired one would have
to use the format:

```yaml
possible_values:
    - value
```

But now once can use

```yaml
possible_values: value
```

Closes #614
Closes #613
2016-08-21 08:33:53 +09:00
Kevin K
9ade2cd4b2 feat(YAML): allows using lists or single values with arg declarations
One can now use a list or single value for certain Arg YAML declarations
such as possible_values, etc.

Prior to this commit, if only a single value was desired one would have
to use the format:

```yaml
possible_values:
    - value
```

But now once can use

```yaml
possible_values: value
```

Closes #614
Closes #613
2016-08-20 18:59:24 -04:00
Homu
37cc3c367f Auto merge of #619 - kbknapp:issue-618, r=kbknapp
Issue 618
2016-08-21 07:13:07 +09:00
Kevin K
7bc1b4b6c7 chore: clippy run 2016-08-20 17:52:03 -04:00
Kevin K
565d21f71c chore: allows failing beta until vec_map/#20 is fixed 2016-08-20 17:52:03 -04:00
Kevin K
e203515e3a fix(Help Subcommand): fixes misleading usage string when using multi-level subcommmands
For example, doing `myprog help subcmd1 subcmd2` would have incorrectly
produced the usage string, `myprog subcmd2 [options]` but now correctly
prints `myprog subcmd1 subcmd2 [options]`

Closes #618
2016-08-20 17:17:58 -04:00
Kevin K
9e8e350b95 tests: adds tests for multi level help subcommands 2016-08-20 17:17:58 -04:00
Jesús Espino
bba598931a Fix issue #607: Remove already matched parameters on errors of required 2016-08-06 00:08:31 +02:00
Kevin K
a983bd9b7e doc: small fixes (#612) 2016-07-30 11:29:37 -04:00
Homu
8b41e94071 Auto merge of #611 - kbknapp:v2.10.0, r=kbknapp
chore: increase version
2016-07-29 11:47:18 +09:00
Kevin K
522d934b1b chore: increase version 2016-07-28 22:28:47 -04:00
Homu
3f79467e6b Auto merge of #610 - kbknapp:starkat99-fix-subcommand-name, r=kbknapp
Starkat99 fix subcommand name
2016-07-29 11:08:28 +09:00
Kevin K
32dba379d4 Merge branch 'fix-subcommand-name' of https://github.com/starkat99/clap-rs into starkat99-fix-subcommand-name 2016-07-28 21:16:09 -04:00
Tshepang Lekhonkhobe
13233d7f2f doc: small fixes (#609) 2016-07-28 21:15:10 -04:00
Homu
7d0d447ddb Auto merge of #605 - kbknapp:wdv4758h-fish-completion, r=kbknapp
Wdv4758h fish completion

merge of #579
2016-07-28 10:47:27 +09:00
Kevin K
ccdd0571c2 Merge branch 'fish-completion' of https://github.com/wdv4758h/clap-rs into wdv4758h-fish-completion 2016-07-27 21:15:39 -04:00
Kathryn Long
875df24316 fix(parser): preserve external subcommand name
BREAKING CHANGE: Access external subcommand arguments using an empty
argument name (i.e. `values_of("")`) instead of the previous subcommand
name.
2016-07-26 23:56:52 -05:00
Kathryn Long
aebc8fd828 tests(template): fix template asserts on windows 2016-07-26 23:46:06 -05:00
Chiu-Hsiang Hsu
1979d2f2f3 feat(Completions): one can generate a basic fish completions script at compile time
The following completion would happen (using example 17_yaml.rs):

```
$ prog <tab>
help subcmd
```

```
$ prog -<tab><tab>
--help  -h                            (Prints help information)
--max-vals      (you can only supply a max of 3 values for me!)
--min-vals  (you must supply at least two values to satisfy me)
--mode                   (shows an option with specific values)
--mult-vals        (demos an option which has two named values)
--option  -o                (example option argument from yaml)
--version  -V                      (Prints version information)
-F                                         (demo flag argument)
```

```
$ prog --<tab><tab>
--help  -h                            (Prints help information)
--max-vals      (you can only supply a max of 3 values for me!)
--min-vals  (you must supply at least two values to satisfy me)
--mode                   (shows an option with specific values)
--mult-vals        (demos an option which has two named values)
--option  -o                (example option argument from yaml)
--version  -V                      (Prints version information)
```

```
$ prog --mode <tab>
emacs  (shows an option with specific values)  vi  (shows an option with specific values)
```

```
$ prog subcmd -<tab>
--help  -h        (Prints help information)  -B  (example subcommand option)
--version  -V  (Prints version information)
```

```
$ prog subcmd --<tab>
--help  (Prints help information)  --version  (Prints version information)
```

Close #578
2016-07-26 10:15:37 +08:00
Homu
c810becd4f Auto merge of #603 - kbknapp:issue-601, r=kbknapp
docs(YAML): fixes example 17's incorrect reference to arg_groups inst…

…ead of groups

Closes #601
2016-07-26 10:15:26 +09:00
Kevin K
7bf76b889b chore: clippy run 2016-07-25 20:56:22 -04:00
Kevin K
66c411a044 chore: update deps 2016-07-25 20:56:13 -04:00
Kevin K
b6c99e1377 docs(YAML): fixes example 17's incorrect reference to arg_groups instead of groups
Closes #601
2016-07-25 20:15:58 -04:00
Kevin K
9605ea83aa chore: increase version (#599) 2016-07-24 00:13:00 -04:00
Barret Rennie
0ceba231c6 feat(Settings): Add unset_setting and unset_settings fns to App (#598)
Closes #590.
2016-07-24 00:08:24 -04:00
Homu
84a08758b2 Auto merge of #596 - rtaycher:authors, r=kbknapp
removed unstable gate from crate_authors

The cargo feature it depends on has been available since april, I think we can make this stable now.
2016-07-24 12:22:47 +09:00
Roman A. Taycher
3398b64b5a Merge branch 'master' into authors 2016-07-23 16:39:29 -07:00
Roman A. Taycher
05edc4338e removed unstable gate from crate_authors 2016-07-23 15:56:42 -07:00
Homu
8830dc4edf Auto merge of #595 - kbknapp:issues-575,593, r=kbknapp
Issues 575,593
2016-07-24 06:52:40 +09:00
Kevin K
625cbbca0d test: adds tests for required_unless_one cases 2016-07-23 17:22:14 -04:00
Kevin K
1fc3b55bd6 fix: fixes bug where only first arg in list of required_unless_one is recognized
Closes #575
2016-07-23 17:21:47 -04:00
Kevin K
fc72cdf591 fix(Settings): fixes typo subcommandsrequired->subcommandrequired
Closes #593
2016-07-23 16:25:17 -04:00
Christopher Field
1b99091e0a tests: adds require_unless_one test cases
* test: `require_unless_one` with second argument

Add the `require_unless_one_2` test. This tests that when the second
argument in the array is used at the command line, that the required
argument is not present. This test was added because it appears the
`require_unless_one` function only works for the first argument in the
array.

* Fix: assertions for test

The assertions did not check for the `infile` to be present.
2016-07-23 13:43:22 -04:00
Homu
af4bb4c6d5 Auto merge of #570 - davidszotten:gen_completion_to, r=kbknapp
add `gen_completions_to`

to write completions to buffer (e.g. stdout) instead of file. fixes #566

(for review; will fix commit message when done)

still pretty new to rust so comments on anything from style to structure would be must appreciated!
2016-07-24 02:21:18 +09:00
David Szotten
9f62cf7378 feat(Completions): adds the ability to generate completions to io::Write object 2016-07-14 09:38:13 +01:00
Homu
691ef58dfb Auto merge of #571 - gohyda:master, r=kbknapp
Fix: typo and missing color
2016-07-14 01:33:19 +09:00
Bence Szigeti
8c32b4b63f Fix: missing color 2016-07-05 23:16:44 +02:00
Bence Szigeti
f8ca3085da Fix: typo -- missing space and commas 2016-07-05 22:14:47 +02:00
Bence Szigeti
8d7bea823f Fix: extra space typo removed 2016-07-05 22:01:04 +02:00
Homu
6398ca435b Auto merge of #569 - iliekturtles:patch-1, r=kbknapp
Fix get_matches typo
2016-07-04 23:35:54 +09:00
Mike Boutin
b3cdc3b5c2 Fix get_matches typo 2016-07-04 10:19:36 -04:00
Homu
3680ce85e3 Auto merge of #565 - kbknapp:issue-563, r=kbknapp
Issue 563
2016-07-04 00:54:41 +09:00
Kevin K
4e60b2254d chore: increase version 2016-07-03 10:55:49 -04:00
Kevin K
cecfe981ea fix(Completions): fixes bug where --help and --version short weren't added to the completion list
Closes #563
2016-07-03 10:55:40 -04:00
Homu
0b4ee665ad Auto merge of #562 - swatteau:fix-compl-doc, r=kbknapp
Fix the formatting in the completions example

A missing newline prevented the Cargo.toml excerpt in the `gen_completions` example from being properly formatted.
2016-07-02 21:30:48 +09:00
Sébastien Watteau
722f2607be docs(Completions): fixes the formatting of the Cargo.toml excerpt in the completions example 2016-07-02 09:31:09 +02:00
Homu
11b92170ef Auto merge of #561 - kbknapp:compl-mult-bin, r=kbknapp
Compl mult bin
2016-07-02 11:41:46 +09:00
Kevin K
9e9d92a3bd chore: increase version 2016-07-01 22:16:47 -04:00
Kevin K
57484b2dae imp(Completions): allows multiple completions to be built by namespacing with bin name
Completions are now written `<bin>_<shell>.<ext>` vice the old, `<shell>.<ext>`
2016-07-01 22:15:23 -04:00
Kevin K
f10375ebe0 Merge pull request #560 from kbknapp/issue-558
Issue 558
2016-07-01 16:14:22 -04:00