Commit graph

1442 commits

Author SHA1 Message Date
Kevin K
ca511de71f imp(Aliases): improves readability of asliases in help messages
Aliases are now displayed after the help text inside a `[aliases: als1, als2, als3]` style box.

Closes #526
Closes #529
2016-06-12 21:50:31 -04:00
Homu
50ca205e3b Auto merge of #525 - kbknapp:issues-521,522, r=kbknapp
Issues 521,522
2016-06-10 19:17:44 +09:00
Kevin K
2ff981b9be tests: adds tests for visible aliases 2016-06-09 22:50:02 -04:00
Kevin K
7b10e7f893 feat(Subcommands): adds support for visible aliases
This commit adds support for visible aliases, which function exactly like aliases except that they
also appear in the help message, using the help string of the aliased subcommand.

i.e.

```rust
App::new("myprog")
    .subcommand(SubCommand::with_name("test")
		.about("does testy things")
		.alias("invisible")
		.visible_alias("visible"));
```

When run with `myprog --help`, the output is:

```
myprog

USAGE:
	myprog [FLAGS] [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    help	        Prints this message or the help of the given subcommand(s)
    test|visible    does testy things
```

Closes #522
2016-06-09 21:55:35 -04:00
Kevin K
5354d14b51 fix(Subcommands): subcommands with aliases now display help of the aliased subcommand
Imagine subcommand `foo` had alias `bar`, running `myprog help bar` now correctly displays the help
for `foo`

Closes #521
2016-06-09 20:39:53 -04:00
Homu
e1d33f8f22 Auto merge of #524 - kbknapp:issues-511,523, r=kbknapp
Issues 511,523
2016-06-08 19:58:33 +09:00
Kevin K
d0fd55a78a chore: updates pinned nightly version for TravisCI 2016-06-08 00:14:46 -04:00
Kevin K
1bfae42eaf refactor: clippy run 2016-06-08 00:10:56 -04:00
Kevin K
fe0818b854 chore: unpins clippy version
Closes #523
2016-06-07 23:52:52 -04:00
Kevin K
cef4a9fa1f chore: deletes accidental file 2016-06-07 23:49:36 -04:00
Kevin K
785ff83a14 tests(Settings): adds tests for DontDelimitTrailingValues 2016-06-07 23:49:05 -04:00
Kevin K
fc3e0f5afd feat(Settings): adds new setting to stop delimiting values with -- or TrailingVarArg
One can now use `AppSettings::DontDelimitTrailingValues` to stop clap's default behavior of
delimiting values, even when `--` or `TrailingVarArg` is used. This is useful when passing other
flags and commands through to another program.

Closes #511
2016-06-07 23:49:05 -04:00
Kevin K
7db45f78d8 chore: removes extra debug statements 2016-06-07 23:49:05 -04:00
Kevin K
706a7c11b0 fix(Settings): fixes bug where new color settings couldn't be converted from strs 2016-06-07 23:49:05 -04:00
Homu
a77c800da7 Auto merge of #520 - kbknapp:issues-512,518,519, r=kbknapp
Issues 512,518,519
2016-06-08 10:16:16 +09:00
Kevin K
01e7dfd6c0 fix(Windows): fixes a failing windows build 2016-06-07 20:49:18 -04:00
Kevin K
0d541a2534 Merge branch 'master' into issues-512,518,519 2016-06-04 21:13:49 -04:00
Kevin K
6e7f3e0556 tests(Usage Strings): adds tests for single positional arg usage strings 2016-06-04 11:55:47 -04:00
Kevin K
ec86f2dada imp(Usage Strings): improves the default usage string when only a single positional arg is present
Instead of blindly printing `[ARGS]` when only a single positional arg is present, it will now
print `[NAME]` (or `[NAME]...` for multiple values allowed)

Closes #518
2016-06-04 11:55:47 -04:00
Kevin K
17bc17c699 tests(Settings): adds tests for global subcommands 2016-06-04 11:55:47 -04:00
Kevin K
e23418351a feat(Settings): one can now set an AppSetting which is propogated down through child subcommands
Closes #519
2016-06-04 11:55:47 -04:00
Kevin K
cd44080650 fix: fixes bug where args are printed out of order with templates 2016-06-04 11:55:47 -04:00
Kevin K
04d27ce803 chore: increase version 2016-06-04 11:55:47 -04:00
Kevin K
8f630c6a07 fix: fixes bug where one can't override version or help flags
Closes #514
2016-06-04 11:55:47 -04:00
Kevin K
9582b82789 tests: adds test to check for before_help 2016-06-04 11:55:47 -04:00
Kevin K
330e5edf04 fix: fixes issue where before_help wasn't printed 2016-06-04 11:55:47 -04:00
Kevin K
c8cc87ac10 tests: updates help tests to remove extra newline 2016-06-04 11:55:47 -04:00
Kevin K
054f8cb433 imp: removes extra newline from help output 2016-06-04 11:55:47 -04:00
Kevin K
c5b24c0eb0 tests: removes extra newline from version output tests 2016-06-04 11:28:24 -04:00
Kevin K
a7401dc6a1 imp: allows printing version to any io::Write object 2016-06-04 11:28:24 -04:00
Kevin K
cda27469cd imp: removes extra newline when printing version 2016-06-04 11:28:24 -04:00
Kevin K
65c2350aa3 feat: colors dont get sent to pipes by default
Color are now only used when outputting to a termainal/TTY. There are three new settings as well
which can be used to control color output, they are:

 * `AppSettings::ColorAuto`: The default, and will only output color when outputting to a terminal or TTY
 * `AppSettings::ColorAlways`: Outputs color no matter where the output is going
 * `AppSettings::ColorNever`: Never colors output

This now allows one to use things like command line options, or environmental variables to turn
colored output on/off.

Closes #512
2016-06-04 11:28:03 -04:00
Homu
34e608c124 Auto merge of #517 - kbknapp:quick-issues, r=kbknapp
Quick issues

Relates to #515 #516 #514
2016-05-31 19:42:29 +09:00
Kevin K
05abb53486 fix: fixes bug where args are printed out of order with templates 2016-05-31 04:43:47 -04:00
Kevin K
638bf11cfe chore: increase version 2016-05-31 04:43:47 -04:00
Kevin K
90d7d6a2ea fix: fixes bug where one can't override version or help flags
Closes #514
2016-05-31 04:41:46 -04:00
Kevin K
24423e661e tests: adds test to check for before_help 2016-05-31 04:41:08 -04:00
Kevin K
b3faff6030 fix: fixes issue where before_help wasn't printed 2016-05-31 04:41:07 -04:00
Kevin K
84029aba18 tests: updates help tests to remove extra newline 2016-05-31 04:41:07 -04:00
Kevin K
86e61d19a7 imp: removes extra newline from help output 2016-05-31 04:41:07 -04:00
Kevin K
65b1de6d1f tests: removes extra newline from version output tests 2016-05-31 04:41:07 -04:00
Kevin K
921f5f7916 imp: allows printing version to any io::Write object 2016-05-30 04:48:47 -04:00
Kevin K
7e2e2cbb4a imp: removes extra newline when printing version 2016-05-30 04:48:13 -04:00
Homu
a86d6aac4b Auto merge of #508 - kbknapp:issue-505, r=kbknapp
docs: inter-links all types and pages

All doc pages should now be inter-linked between other doc pages and
Rust documentation.

Closes #505
2016-05-16 04:15:08 +09:00
Kevin K
3312893dda docs: inter-links all types and pages
All doc pages should now be inter-linked between other doc pages and
Rust documentation.

Closes #505
2016-05-15 14:23:37 -04:00
Homu
d392fd0edc Auto merge of #507 - kbknapp:issue-505, r=kbknapp
docs: makes all publicly available types viewable in docs

Some types weren't viewable in the docs, such as `Values`, `OsValues`,
and `ArgSettings`. All these types should now be browsable in the
docs page.

Relates to #505
2016-05-14 09:18:19 +09:00
Kevin K
52ca6505b4 docs: makes all publicly available types viewable in docs
Some types weren't viewable in the docs, such as `Values`, `OsValues`,
and `ArgSettings`. All these types should now be browsable in the
docs page.

Relates to #505
2016-05-13 18:52:29 -04:00
Kevin K
0c6c4ad743 Merge pull request #504 from kbknapp/v2.5.1
chore: increase version
2016-05-11 15:53:15 -04:00
Kevin K
d681a5b32c chore: increase version 2016-05-11 15:52:21 -04:00
Homu
11270d68d5 Auto merge of #503 - hoodie:master, r=kbknapp
test: adds failing alias doc test and example

Hey there,
I tried out the new aliasing feature, and they don't seem to play well with `.arg()`.
This produces a lifetime errors:

```bash
examples/20_aliases.rs:9:59: 9:74 error: borrowed value does not live long enough
examples/20_aliases.rs:9                                                 .aliases(&["list", "dir"])
                                                                                   ^~~~~~~~~~~~~~~
```
2016-05-12 04:31:34 +09:00