Commit graph

1471 commits

Author SHA1 Message Date
Kevin K
1ea9bef20d
test(Help Wrapping): adds tests for the old newline characters 2016-09-12 23:20:40 -04:00
Kevin K
92ac353b48
fix(Help Wrapping): fixes a regression-bug where the old {n} newline char stopped working
As of this commit, one can use the old newline character `{n}` or the new `\n`

Closes #661
2016-09-12 23:19:26 -04:00
Homu
804a60f781 Auto merge of #660 - kbknapp:issue-588, r=kbknapp
Issue 588
2016-09-13 11:25:56 +09:00
Kevin K
fd4414768d
chore: increase version 2016-09-12 21:59:46 -04:00
Kevin K
a9699e4d7c
fix(AllowLeadingHyphen): fixes a bug where valid args aren't recognized with this setting
Closes #588
2016-09-12 21:48:50 -04:00
Kevin K
0dcfc77dae
tests(Debugging): standardizes certain debugging calls 2016-09-12 21:48:22 -04:00
Homu
703b001d06 Auto merge of #658 - kbknapp:issue-640, r=kbknapp
Issue 640
2016-09-12 03:09:32 +09:00
Kevin K
8ffd7b827c Merge branch 'master' into issue-640 2016-09-11 13:00:04 -04:00
Homu
317402d9e1 Auto merge of #659 - nabijaczleweli:docs/appsettings/disableversion-doc, r=kbknapp
Document AppSetting::DisableVersion

Closes #589
2016-09-12 00:28:07 +09:00
nabijaczleweli
945019654d
docs(appsettings): Document AppSetting::DisableVersion
Closes #589
2016-09-11 10:31:35 +02:00
Kevin K
4c8ae08e4c
tests(Help): adds tests for per argument hiding of possible values 2016-09-10 23:11:43 -04:00
Kevin K
9151ef7398 feat(Help): adds ability to hide the possible values on a per argument basis
Previously one could only hide the possible values of an argument application or command wide, and
not on a per argument basis. Now one can use the `Arg::hide_possible_values(bool)` method to hide
only that arguments possible values.

Closes #640
2016-09-10 23:07:15 -04:00
Homu
82234fa93f Auto merge of #657 - kbknapp:issue-655, r=kbknapp
Issue 655
2016-09-11 11:19:41 +09:00
Kevin K
f9d17a060a docs(Value Delimiters): updates the docs for the Arg::multiple method WRT value delimiters and default settings 2016-09-10 18:23:31 -04:00
Kevin K
f9e692548e imp(Value Delimiters): changes the default value delimiter rules
Prior to this change, values were always delimited by default. This was causing issues with code
where the arg had a single value, and contained valid commas and shouldn't be delimited. This
commit changes the rules slightly so that values are not delimited by default, *unless* one of the
methods which implies multiple values was used (max_values, value_names, etc.).

This means single value args should *not* be delimited by default. If one wishes to use the old
way, they can add `Arg::use_delimiter(true)` to such code.

Closes #655
2016-09-10 18:19:33 -04:00
Kevin K
9881a4a23a tests(Value Delimiters): updates tests to new value delimiter rules 2016-09-10 18:18:43 -04:00
Homu
3834063d10 Auto merge of #654 - nabijaczleweli:feature/help/term-width-override, r=kbknapp
Allow for limiting detected term width

Closes #653
2016-09-11 04:44:21 +09:00
nabijaczleweli
a43e28af85
feat(help): allow for limiting detected terminal width
Useful when, e.g., the terminal is fullscreen

Closes #653
2016-09-10 21:19:35 +02:00
Homu
377b5f20da Auto merge of #652 - nabijaczleweli:perf/help/remove-redundant-contains, r=kbknapp
Fix redundant contains() checks

Addresses comments on c76785239f
2016-09-09 05:58:33 +09:00
nabijaczleweli
a8afed7428
perf(help): fix redundant contains() checks
Addresses comments from c76785239f
2016-09-08 21:56:07 +02:00
Homu
59bee8413b Auto merge of #651 - kbknapp:v2.11.3, r=kbknapp
chore: increase version
2016-09-09 04:43:02 +09:00
Kevin K
aded9abdc5 chore: increase version 2016-09-07 17:40:38 -04:00
Homu
345e0e333f Auto merge of #650 - kbknapp:issue-617, r=kbknapp
Issue 617
2016-09-08 00:24:08 +09:00
Kevin K
2e99e22630 Merge branch 'master' into issue-617 2016-09-07 10:45:27 -04:00
Kevin K
934094d7c5 tests: updates tests for new help wrapping rules 2016-09-07 08:42:42 -04:00
Kevin K
c5a2b352ca docs(Help Wrapping): removes the verbage about using '{n}' to insert newlines in help text 2016-09-07 08:42:10 -04:00
Kevin K
c76785239f imp(Help Wrapping): clap now ignores hard newlines in help messages and properly re-aligns text, but still wraps if the term width is too small
Prior to this commit, clap would mangle help messages with hard newlines
(see #617). After this commit, clap will ignore hard newlines and treat
them like an inserted newline, properly wrapping and aligning text and
then restarting it's count until the next newline should be inserted.

This commit also removes the need for using `{n}` to insert a newline in
help text, now the traditional `\n` can be used. For backwards
compatibility, the `{n}` still works.

Closes #617
2016-09-07 08:38:26 -04:00
Homu
fed1ff5a31 Auto merge of #649 - AluisioASG:yaml-require-delimiter, r=kbknapp
imp(YAML): supports setting Arg::require_delimiter from YAML

Seems this is missing from 920b559.
2016-09-07 06:04:22 +09:00
Aluísio Augusto Silva Gonçalves
b9b55a39df
imp(YAML): supports setting Arg::require_delimiter from YAML 2016-09-06 13:30:31 -03:00
Kevin K
0d503504d2 Merge branch 'master' of github.com:kbknapp/clap-rs 2016-09-05 22:12:12 -04:00
Homu
fa5f853469 Auto merge of #648 - kbknapp:help-imps, r=kbknapp
Help imps
2016-09-06 10:29:18 +09:00
Kevin K
60de29a7ef tests: updates test to new help improvements 2016-09-05 20:46:18 -04:00
Kevin K
e4f194c82b chore: increase version 2016-09-05 20:16:09 -04:00
Kevin K
5658b117ae imp(Help Wrapping): makes some minor changes to when next line help is automatically used 2016-09-05 20:14:05 -04:00
Kevin K
01cae7990a imp(Help Wrapping): makes some minor changes to when next line help is automatically used 2016-09-05 19:51:14 -04:00
Homu
7e21b443ba Auto merge of #647 - kbknapp:issue-638, r=kbknapp
Issue 638
2016-09-06 06:39:58 +09:00
Kevin K
3617a1d493 test: updates app_settings tests for new bug fixes 2016-09-05 17:16:40 -04:00
Kevin K
c28d093076 chore: increase version 2016-09-05 17:06:41 -04:00
Kevin K
df06ea61ee chore: updates ansi_term dep 2016-09-05 17:04:32 -04:00
Kevin K
b246be1a4b style: rustfmt run 2016-09-05 17:03:45 -04:00
Kevin K
b3efc10751 fix(Settings): fixes an issue where settings weren't propogated down through grand-child subcommands
In some cases settings were only propogated down one level deep, this
commit ensures settings are propogated down through all subcommands
recursively.

Closes #638
2016-09-05 17:01:22 -04:00
Homu
48bc038e5a Auto merge of #646 - kbknapp:vks-custom-error, r=kbknapp
Vks custom error
2016-09-06 04:57:40 +09:00
Kevin K
07e6e8ea31 style: rustfmt run 2016-09-05 15:29:40 -04:00
Kevin K
c6219ec5ed chore: re-establish beta and udpate clippy nightly pin 2016-09-05 15:16:17 -04:00
Kevin K
956965cc94 chore: clippy run 2016-09-05 15:14:47 -04:00
Kevin K
24a6c61cf8 chore: updates term_size dep 2016-09-05 14:54:52 -04:00
Vinzent Steinberg
58512f2fcb feat(Errors): Errors with custom description
This is useful if a more meaningful message can be displayed to the
user with `Error::exit`. For example, if a file is not found, the
converted `io::Error` will give a message like:

    "error: entity not found"

With this, it is possible to replace this message with a more useful
one, like for instance:

    "error: configuration file not found"

Coloring is respected. Some duplication in the `From::from` impls was
reduced.
2016-09-05 14:54:14 -04:00
Homu
26d5207728 Auto merge of #639 - nabijaczleweli:improvement/help/wrap-use-term_size, r=kbknapp
Use term_size instead of home-grown solution

Ref: #631
2016-09-06 00:18:42 +09:00
nabijaczleweli
fc7327e9dc
imp(help): use term_size instead of home-grown solution 2016-08-29 07:36:06 +02:00
Kevin K
b7793a2f4d Issues rollup (#637)
* feat: adds App::with_defaults to automatically use crate_authors! and crate_version! macros

One can now use

```rust
let a = App::with_defaults("My Program");

// same as
let a2 = App::new("My Program")
	.version(crate_version!())
	.author(crate_authors!());
```

Closes #600

* imp(YAML Errors): vastly improves error messages when using YAML

When errors are made while developing, the panic error messages have
been improved instead of relying on the default panic message which is
extremely unhelpful.

Closes #574

* imp(Completions): uses standard conventions for bash completion files, namely '{bin}.bash-completion'

Closes #567

* imp(Help): automatically moves help text to the next line and wraps when term width is determined to be too small, or help text is too long

Now `clap` will check if it should automatically place long help
messages on the next line after the flag/option. This is determined by
checking to see if the space taken by flag/option plus spaces and values
doesn't leave enough room for the entirety of the help message, with the
single exception of of if the flag/option/spaces/values is less than 25%
of the width.

Closes #597

* tests: updates help tests to new forced new line rules

* fix(Groups): fixes some usage strings that contain both args in groups and ones that conflict with each other

Args that conflict *and* are in a group will now only display in the
group and not in the usage string itself.

Closes #616

* chore: updates dep graph

Closes #633

* chore: clippy run

* style: changes debug header to match other Rust projects

* chore: increase version
2016-08-27 23:42:31 -04:00