Commit graph

4592 commits

Author SHA1 Message Date
Ed Page
ac0f59ef73
Merge pull request #38 from epage/rename
Handle more naming issues
2021-11-29 12:10:22 -06:00
Ed Page
5911b64255
Merge pull request #39 from epage/ci
chore(ci): Verify unicode feature
2021-11-29 11:46:33 -06:00
Ed Page
e4c5d9d68d chore(ci): Verify unicode feature
In #27, we removed some default features.  When doing so, some places
weren't updated but `doc` feature covered it ... except it was only
partially updated.  This makes sure we test all the features.
2021-11-29 11:30:23 -06:00
Ed Page
44700506eb docs: Be consistent in builder args 2021-11-29 11:21:45 -06:00
Ed Page
62d7a3a928 fix: Be consistent on hide/hidden
- `PossibleValue::hidden` -> `PossibleValue::hide` (new in clap3, no
  breakin change)

Fixes #33
2021-11-29 10:58:00 -06:00
Ed Page
57e5fc2b07 fix: Rename to Arg::ignore_case like ArgSettings
Fixes #32
2021-11-29 10:34:42 -06:00
Ed Page
8fc12586bb fix: Make AppSettings::HidePossibleValues mirror ArgSettings
Fixes #31
2021-11-29 10:28:31 -06:00
Ed Page
6316e8a7fe
Merge pull request #37 from epage/unset
docs: Emphasize `Arg` over `ArgSettings`
2021-11-29 10:12:05 -06:00
Ed Page
eae3ffb599 docs: Emphasize Arg over ArgSettings 2021-11-29 09:54:04 -06:00
Kurt Wolf
a9f4d759c0 Allow bash completions to work with an alias (clap-rs/clap#2054) 2021-11-29 09:02:52 -06:00
bors[bot]
39374acb90
Merge #3054
3054: Allow bash completions to work with an alias r=pksunkara a=kurtbuilds



Co-authored-by: Kurt Wolf <kurtwolfbuilds@gmail.com>
2021-11-28 22:04:36 +00:00
Kurt Wolf
36a6360055 Allow bash completions to work with an alias 2021-11-28 12:15:42 -05:00
Ed Page
bc4c29056f
Merge pull request #35 from epage/docs
doc: Polish reference API
2021-11-24 20:00:32 -06:00
Ed Page
d1eec17d03 docs: Remove references to YAML 2021-11-24 16:09:56 -06:00
Ed Page
a2f0863a30 docs: Polish reference API 2021-11-24 16:09:53 -06:00
Ed Page
7bb729fe25
Merge pull request #30 from epage/doc
docs: Include more features in rustdoc
2021-11-24 14:28:20 -06:00
Ed Page
6a56a98a12 docs: Include more features in rustdoc 2021-11-24 14:07:57 -06:00
Ed Page
cdff449d19
Merge pull request #29 from epage/expected
fix: Rename HelpRequired to HelpExpected
2021-11-24 11:57:49 -06:00
Ed Page
314a6a36bb fix: Rename HelpRequired to HelpExpected
This both distances itself from our 'require' terminology and aligns
itself with `Option::expect`, making it more likely for people to guess
the intended behavior.
2021-11-24 11:38:57 -06:00
Ed Page
5210744d3a
Merge pull request #26 from epage/hyphen
fix: Rename App's AllowLeadingHyphen to AllowHyphenValues
2021-11-24 11:38:26 -06:00
Ed Page
af76c215b7
Merge pull request #28 from epage/debug
Color debug output
2021-11-24 11:36:31 -06:00
Ed Page
e6fca5446b
Merge pull request #27 from epage/features
fix!: Lighten clap's default feature set
2021-11-24 11:36:25 -06:00
Ed Page
c15a0bf5b3 fix: Rename App's AllowLeadingHyphen to AllowHyphenValues
This aligns us with `Arg::allow_hyphen_values` in clap2.
2021-11-24 11:25:48 -06:00
Ed Page
4b72d3cc7f feat: Color debug output 2021-11-24 11:21:40 -06:00
Ed Page
463d75474e refactor(color): Track style, rather than details
This makes it easier for us to compose.  Before, we had to infer things
like "bold" based on the color.  Now we just say "error" and get all of
the formatting specific to that.
2021-11-24 11:21:40 -06:00
Ed Page
c0f0713248 fix!: Lighten clap's default feature set
Too many times people have to disable default features.  Let's try to
have a more minimal out of box experience.

- `derive`: people are already used to adding this feature for serde
- `cargo`: not needed for derive
- `env`: most probably don't use this
- `unicode`: most CLIs are probably ASCII.  We should do a debug warn
  about this though

BREAKING CHANGE: `derive`, `cargo`, `env`, and `unicode` are no longer
on by default.
2021-11-24 10:35:29 -06:00
Ed Page
6a580d4de2 fix: Deprecate, rather than remove, AllowLeadingHyphen 2021-11-24 10:24:18 -06:00
Pavan Kumar Sunkara
afa7346f74 Remove extern crate in doc tests to fix coverage (clap-rs/clap#3047) 2021-11-24 09:17:20 -06:00
Ed Page
c2c9f0acb1
Merge pull request #23 from epage/examples
test: Verify examples based on feature flags
2021-11-24 09:08:43 -06:00
bors[bot]
6fae3f1a07
Merge #3047
3047: Remove extern crate in doc tests to fix coverage r=ldm0 a=pksunkara



Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
2021-11-24 09:03:52 +00:00
Ed Page
9c4194a5a1 test: Verify examples based on feature flags 2021-11-23 17:10:01 -06:00
Ed Page
020d55e832
Merge pull request #22 from epage/ci
Fix CI bugs
2021-11-23 16:40:24 -06:00
Ed Page
da03c2706c chore(ci): Run build/test all crates 2021-11-23 16:10:32 -06:00
Ed Page
6b5e7e28df chore(ci): Test benchmarks 2021-11-23 16:09:31 -06:00
Mooneyhan
8bc8967498 corrected minor grammar mistakes in README.md (clap-rs/clap#3033) 2021-11-23 13:25:47 -06:00
Ed Page
0fccd07001
Merge pull request #21 from epage/trycmd
test: More thoroughly test examples
2021-11-23 13:24:22 -06:00
Ed Page
bfa02fd418 test: More thoroughly test examples
This ports our example testing over to [trycmd](https://docs.rs/) so
we can:
- More thoroughly test our examples
- Provide always-up-to-date example usage

The old way of testing automatically picked up examples.  This new way
requires we have a `.md` file that uses the example in some way.

Notes:
- Moved overall example description to the `.md` file
- I added cross-linking between related examples
- `14_groups` had a redundant paragraph (twice talked about "one and
  only one"
2021-11-23 13:13:41 -06:00
Ed Page
d8b12a6bb5
Merge pull request #20 from epage/macro
Deprecate YAML and Usage Parser
2021-11-23 12:09:51 -06:00
bors[bot]
fcdce72bce
Merge #3033
3033: corrected minor grammar mistakes in README.md r=pksunkara a=ConnorMooneyhan



Co-authored-by: Mooneyhan <Connor.Mooneyhan@conehealth.com>
2021-11-23 17:18:54 +00:00
Ed Page
d4173bd596 docs: Clean up deprecations 2021-11-23 10:32:05 -06:00
Ed Page
3c3a0b71d1 fix: Deprecate runtime usage parser
Fixes #8
2021-11-23 09:53:04 -06:00
Ed Page
4c4a2b86a0 refactor: Port over to arg! 2021-11-23 09:37:14 -06:00
Pavan Kumar Sunkara
59a8cc12df Remove extern crate in doc tests to fix coverage 2021-11-23 11:10:08 +00:00
Pavan Kumar Sunkara
b02d1c53a9 Add DisableColoredHelp setting to improve flexibility 2021-11-23 10:57:41 +00:00
Ed Page
263fe30568 feat: Usage parser macro
This is intended to replace the runtime usage parser and is not meant to
be a complete API in of itself, like `clap_app!`.  What is in scope is
everything that visually makes sense as in a usage string (see
[docopt](http://docopt.org/) for inspiration).  General setting of
attributes is out of scope.

This deviates from both `clap_app` and the runtime usage parser
- `clap_app` supported multiple values but has a bug because we made
  `Arg::value_name` non-appending, so we aren't supporting this yet
- We do not yet support optional flags that take a value
- In both, `...` is multiple occurrences and values while its only
  multiple occurrences for us
- We explicitly support optional values for flags
- Unlike `clap_app`, our name is optional
- Unlike runtime usage parser, our name syntax is simpler
- Unlike runtime usage parser, our name syntax does not allow modifiers

Its more limited than I would like.  Hopefully some people better with
macros can expand the feature set and turn more runtime errors into
compile-time errors.

This is to prepare for deprecating the runtime usage parser (#8).
2021-11-22 16:21:09 -06:00
Ed Page
136c8e229d fix: Arg::default has correct display order 2021-11-22 16:17:46 -06:00
Ed Page
fb917072f5 feat: name API 2021-11-22 16:17:46 -06:00
Ed Page
d159a3c2a4 docs: Clarify macro deprecation 2021-11-22 16:17:46 -06:00
Ed Page
19cd5ae9f0 docs: Update deprecation refrence 2021-11-22 16:17:46 -06:00
Ed Page
7604b1ed4a revert(usage): Go back to clap2 behavior 2021-11-22 16:17:46 -06:00