Commit graph

446 commits

Author SHA1 Message Date
Mooneyhan
8bc8967498 corrected minor grammar mistakes in README.md (clap-rs/clap#3033) 2021-11-23 13:25:47 -06:00
Ed Page
4c4a2b86a0 refactor: Port over to arg! 2021-11-23 09:37:14 -06:00
Ed Page
6ce9714e2b fix: Deprecate YAML API
Fixes #9
2021-11-22 16:17:46 -06:00
Ed Page
88fff13e71 Revert rename of from_yaml / from_usage
Since usage parser and yaml are on the way to being deprecated (#8, #9),
doing a rename also seems excessive, so rolling it back.

Past relevant PRs:
- clap-rs/clap#1157
- clap-rs/clap#1257
2021-11-22 16:17:46 -06:00
Ed Page
7e899cd340 Revert "Deprecate Arg::help in favour of Arg::about"
This reverts commits 24cb8b1..d0abb37 from clap-rs/clap#1840

This is part of #16.  clap-rs/clap#1840 wasn't the right call but we
don't have time to make the decision now, so instead of having one
option and changing it in 4.0, this reverts back to clap2 behavior.
2021-11-18 12:25:49 -06:00
Ed Page
ff476660ce test: Compile example in README 2021-11-17 21:01:56 -06:00
Ed Page
bfa388420b Put grouped_values_of behind a feature gate
There is enough open work on this, we should probably not have it public
yet, so putting it behind a gate.  See https://github.com/clap-rs/clap/issues/2924
2021-10-26 14:26:50 -05:00
Pavan Kumar Sunkara
585e995811 Release 3.0.0-beta.5 2021-10-17 17:01:18 +01:00
bors[bot]
b835ce9061
Merge #2817
2817: Add support for Multicall executables as subcommands with a Multicall setting r=pksunkara a=fishface60



Co-authored-by: Richard Maw <richard.maw@gmail.com>
2021-10-16 00:32:52 +00:00
Ed Page
61c9e6265b fix(help)!: Merge OPTIONS / FLAGS default groups
For those that want the original behavior, you can usxe
`arg.help_heading(Some("FLAGS"))` on your flags.  Limitations:
- This will not give you a special sort order
- This will not get a `[FLAGS]` added to usage

For templates, we removed `{unified}` and `{flags}`.  To help people
catch these, a debug_assert was added.

I'm unsure but I think there might be a change in behavior in calcuating
when to show `[OPTION]` in usage.  The old code only looked at
`required` while flags looked only at arg groups.  We now look at both.

Ideally we'd add these in `_build` and remove special casing for
no-groups except in the sort order of groups.  I feel like thats best
left for later.

This also reduced the scope of `App`s public API.
`get_*_with_no_heading` seemed a bit specialized to be in the public
API.  #2853 looks at splitting it out into its own PR.

BREAKING CHANGE: Multiple
- `UnifiedHelpMessage` removed
- `{flags}` and `{unified}` are removed and will assert when present.
- `get_*_with_no_heading` removed

Fixes #2807
2021-10-13 11:42:10 -05:00
Pavan Kumar Sunkara
efeb02cd34 fix!: Make color settings an enum 2021-10-13 13:54:44 +01:00
Richard Maw
b808729bbc fixup! Fill in tracking issue number 2021-10-12 20:51:26 +01:00
Richard Maw
b2180e9d72 fixup! Gate Multicall behind unstable feature 2021-10-12 20:35:59 +01:00
Ed Page
0a53fafddf fix: Deprecate Macro API
Fixes #2835
2021-10-11 15:06:38 -05:00
Ed Page
6dd9d467ce fix(help)!: Consoldiate color settings
A lot of users expected `color` feature flag and `ColorAuto` etc to
control all colors.  Having this extra flag around is easy to miss and
adds to our overall settings bloat, making it harder to find settings
people want.

This completely removes it, rather than make it deprecated like
functions in #2617, because there is extra work to mark things
deprecated as Settings and we should decide on our strategy first before
investing time in addressing that issue.

Fixes #2806
2021-10-11 09:01:13 -05:00
bors[bot]
d97c038b1b
Merge #2814
2814: fix(derive)!: Rename `Clap` to `Parser`. r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-10 01:21:47 +00:00
Ed Page
d840d5650e fix(derive)!: Rename Clap to Parser.
Before #2005, `Clap` was a special trait that derived all clap traits it
detected were relevant (including an enum getting both `ArgEnum`,
`Clap`, and `Subcommand`).  Now, we have elevated `Clap`, `Args`,
`Subcommand`, and `ArgEnum` to be user facing but the name `Clap` isn't
very descriptive.

This also helps further clarify the relationships so a crate providing
an item to be `#[clap(flatten)]` or `#[clap(subcommand)]` is more likely
to choose the needed trait to derive.

Also, my proposed fix fo #2785 includes making `App` attributes almost
exclusively for `Clap`.  Clarifying the names/roles will help
communicate this.

For prior discussion, see #2583
2021-10-09 20:12:03 -05:00
Pavan Kumar Sunkara
49aaa5ab0b chore: CI improvements 2021-10-09 19:50:16 +01:00
Ed Page
dfbeb71077 fix: Gate App::replace
We are concerned about the level of polish of this feature and are
unsure enough about its future, we've decided to gate it to unblock the
v3 release.
2021-10-09 10:49:10 -05:00
bors[bot]
5afa640e3b
Merge #2834
2834: fix: Allow unicode-aware case insensitivity with ArgValue r=pksunkara a=epage



Co-authored-by: Ed Page <eopage@gmail.com>
2021-10-09 12:37:33 +00:00
Ed Page
56a6a7418e fix: Allow unicode-aware case insensitivity with ArgValue
This also opens us up to being more unicode aware in other places, like
our sorting of arguments in the help.

Fixes #2792
2021-10-09 07:21:45 -05:00
Ed Page
2bbe9123ee fix!: Generalize unicode feature
This flag was added in v3.  This will allow us to put more related
functionality behind it.

BREAKING CHANGE: `unicode_help` was renamed to `unicode`.
2021-10-09 06:27:28 -05:00
grant0417
f3611ad6b9 feat(generate): Add fig autocomplete generator 2021-10-06 19:42:42 -04:00
Pavan Kumar Sunkara
699a3f76d6 Implement BitOr for settings 2021-09-23 14:57:10 +05:30
Pavan Kumar Sunkara
b8ceab3e6f Fixes #2736 2021-09-04 15:04:09 +05:30
Pavan Kumar Sunkara
52be134949 Release 3.0.0-beta.4
clap@3.0.0-beta.4
clap_derive@3.0.0-beta.4
clap_generate@3.0.0-beta.4

Generated by cargo-workspaces
2021-08-14 23:40:49 +01:00
Pavan Kumar Sunkara
b1752226e2 Fix error 2021-08-14 23:10:05 +01:00
Pavan Kumar Sunkara
73b28fb104 Release 3.0.0-beta.3
clap@3.0.0-beta.3
clap_derive@3.0.0-beta.3
clap_generate@3.0.0-beta.3

Generated by cargo-workspaces
2021-08-14 23:01:13 +01:00
Pavan Kumar Sunkara
c7985fb73e Add env feature gate 2021-08-14 01:55:05 +01:00
Pavan Kumar Sunkara
6994be4f15 Remove doc feature 2021-07-30 22:49:11 +01:00
Ed Page
758e5f337f fix(docs): Ensure examples link works from rustdoc 2021-07-30 10:19:21 +01:00
Ed Page
241d183b9c Bump MSRV to 1.54.0
- This makes it so `doc` compiles on stable

Fixes #2618
2021-07-30 10:19:21 +01:00
patrick-gu
a4dc72ed19 Replace "Prints" with "Print" for default help and version commands 2021-07-29 20:23:25 -07:00
John Breen
a2e5cc2bec
Change some wording to be more inclusive 2021-07-15 17:03:25 -04:00
Kevin Menard
171148873c
Fix a small typo in the README 2021-07-14 17:05:20 -04:00
theidexisted
dd29c3a52c
Simplify example code 2021-07-06 18:00:33 +08:00
Pavan Kumar Sunkara
3f94d17c71 Removed Arg::multiple 2021-06-16 07:17:11 +01:00
Pavan Kumar Sunkara
cedd110f10 Solve indexmap issue on WSL in ubuntu 2021-06-16 02:27:49 +01:00
Pavan Kumar Sunkara
bddb63effe Compare clap with structopt, fixes #1584 2021-05-26 01:08:12 +01:00
Pavan Kumar Sunkara
94ce18c399 Update badges 2021-05-25 23:19:32 +01:00
Ivan Tham
ac8a9582f9
Show default derive example with coloredhelp 2021-04-04 12:08:57 +08:00
Pavan Kumar Sunkara
49954c28ad Remove unstable feature flag 2021-03-13 11:40:56 +05:30
Pavan Kumar Sunkara
975ceed904 Update CI badge on README 2021-03-10 08:04:16 +05:30
ldm0
886b873709 Demangle interlinking flags 2021-03-09 13:45:11 +00:00
Kevin Goslar
205479a2b1
Fix typo 2021-02-24 08:00:59 -06:00
bestgopher
70f49d9fc5
Update README.md
fix INPUT
2021-01-26 15:59:29 +08:00
Jesse Rusak
c85526bd4e docs: add back example of using non-structopt arguments 2021-01-03 14:07:22 -05:00
Riptide3
8b631d5db3 docs(README.md): remove unused import in "Using Builder Pattern" example 2020-11-29 16:10:22 +08:00
Pavan Kumar Sunkara
b89163afb6 Update MSRV to 1.46 2020-11-28 11:58:28 +00:00
Ivan Tham
d985755ca1 Mention colored help is not available by default
While reading the features available, it would be good to be informed that
colored help is available, this makes colored help more discoverable.
2020-11-06 21:51:18 +01:00
Pavan Kumar Sunkara
b931e25c79 Update MSRV to 1.42 2020-10-09 17:04:46 +02:00
Pavan Kumar Sunkara
d881a1185b Release 3.0.0-beta.2
clap@3.0.0-beta.2
clap_derive@3.0.0-beta.2
clap_generate@3.0.0-beta.2

Generated by cargo-workspaces
2020-09-18 20:32:41 +02:00
Pavan Kumar Sunkara
291b52982a Added opencollective sponsors to readme 2020-08-14 16:36:39 +02:00
João Marcos
24760bc261 style: replacing yml with yaml for consistency 2020-07-20 20:58:34 -03:00
Ronald Leppink
036ba49ccf
docs: switch debug and verbosity args in macro example
The other examples have `verbosity` as a default arg, and `debug` as a `test` subcommand arg. The macro example has these two switched up -- this corrects that.
2020-06-28 14:34:48 +02:00
Gabriel Lima
0512e7cea6
docs(README.md): Fixes typo at line 413
Fixes issue #1984
2020-06-25 10:01:52 -03:00
Gonçalo Ribeiro
fb8e0d815d docs: correct some typos 2020-05-30 11:14:47 +01:00
Pavan Kumar Sunkara
7bc282dd4e Rename with_name to new for Arg & ArgGroup 2020-05-14 22:50:56 +02:00
Pavan Kumar Sunkara
954dd3e20a Test readme too 2020-05-02 22:27:45 +02:00
Pavan Kumar Sunkara
a67d1d7a40 Update README for beta release 2020-05-02 22:27:42 +02:00
Noritada Kobayashi
6d62cca1ac docs(README.md): fix a broken link to CONTRIBUTING.md 2020-05-03 03:56:35 +09:00
dbxnr
8769dfa972
Fix link to 13_enum_values example 2020-05-01 21:32:43 +01:00
Richard Hozák
a3603f20fe
Fix README link
Fixes link pointing to archived version of `clap_generate`.
2020-04-17 22:30:40 +02:00
Ivan Tham
54f58e180e Remove extern crate from README 2020-04-08 21:26:32 +08:00
Stephan Boyer
606d120d18 Update the documentation regarding which features are enabled by default 2020-04-04 13:16:30 -07:00
Pavan Kumar Sunkara
b77f159315 Moved to github discussions 2020-04-01 22:32:51 +02:00
CreepySkeleton
16ffaea58d Advertise gitter chat 2020-03-27 18:00:47 +03:00
Justin Walz
dd14f0da74
Update README.md 2020-03-21 17:24:34 -07:00
Akshat Agarwal
848ebb4e44 gitter fix 2020-03-22 02:11:51 +05:30
Kevin K
2b017f5450
docs(README.md): adds details about MSRV by clap version 2020-03-04 22:06:06 -05:00
CreepySkeleton
11f04e229a
Update README.md 2020-02-10 22:16:34 +03:00
CreepySkeleton
a45b116795
Add "work in progress" disclaimer to readme
Closes #1684
2020-02-10 14:47:11 +03:00
Alex van de Sandt
81b8bdd7fc Remove #[macro_use] from examples 2020-02-03 12:01:36 -05:00
Pavan Kumar Sunkara
6c338e42d0 Faster CI 2020-02-03 03:57:52 +01:00
Eric Mink
1c3958c56e Clarify documentation usage as help text for subcommands (#1620)
* Clarify documentation usage as help text for subcommands

As outlined in https://github.com/clap-rs/clap/issues/1619 I did not understand why the `SUBCOMMANDS` section of `help` would not print a String `/// A subcommand for controlling testing` for the `Test` subcommand.

This PR updates the README to hopefully make this clearer.

The only change is adding a doc line:
```rust
#[derive(Clap)]
enum SubCommand {
    /// A help message for the Test subcommand
    Test(Test),
}
```

* Move annotation to the variant

Still regarding https://github.com/clap-rs/clap/issues/1619

I think the line that set the version of the subcommand was at the wrong place.
2020-01-04 19:54:33 +05:30
Matthew Fisher
bb9631eb3f fix(README): fix compiler errors for first example (#1599)
The first example doesn't compile. The Test structure is missing a `struct` statement, and the `.config` field exists as `.file`. Looking at the flag fields, `config` seems like the expected field name.

Using 

```
[dependencies]
clap = { git = "https://github.com/clap-rs/clap", features = ["wrap_help"] }
```

Signed-Off-By: Matthew Fisher <matt.fisher@microsoft.com>
2019-11-30 00:35:26 +01:00
Kevin K
9d58bbee24
docs(README.md): fixes the custom derive example in the readme
Closes #1589
2019-10-30 20:30:29 -04:00
Kevin K
7f046f28ab
Merge pull request #1590 from clap-rs/msrv-1.36
Msrv 1.36
2019-10-30 18:30:44 -04:00
Kevin K
98e8cfe0c4
meta: Bump the minimum supported Rust to 1.36 2019-10-30 16:56:27 -04:00
Dylan DPC
5318342112
Update README.md 2019-10-30 10:28:37 +01:00
Kevin K
4fdca7b4e6
docs: corrects notes about v2 vs v3 branches 2019-10-29 22:30:17 -04:00
Kevin K
1cc872b369
Rename assert_cli to assert_cmd 2019-10-29 22:25:22 -04:00
Dylan DPC
655f4262dd
Add note for 3.0 release (#1503) 2019-10-29 22:24:52 -04:00
Daniel José Domingos Serrano
59c3233a45
Fix yaml docs 2019-10-29 21:49:00 -04:00
Sascha Grunert
b6ebdba2e1
Fix opts variable name in README.md 2019-10-29 21:45:47 -04:00
Yuki Okushi
e56b80b316
Fix license badge on README 2019-10-29 21:44:20 -04:00
Tshepang Lekhonkhobe
a720de3f24
typo 2019-10-29 21:44:01 -04:00
Erick Tryzelaar
d4cd4896dd Bump minimum supported version of Rust to 1.33 2019-06-19 11:21:11 -07:00
Kevin K
3f2a85ef15
Fix Travis CI badge 2019-04-04 13:24:24 -04:00
Kevin K
3550066c88 refactor: cleans out deprecated code in prep for final beta.1 push 2018-11-08 20:34:13 -05:00
Kevin K
03333800fe refactor: remove code going to other crates and deprecations 2018-10-19 23:31:06 -04:00
Kevin K
1ffc9556b7
docs(README.md): stars the v3 update of the docs 2018-08-01 23:05:52 -04:00
Kevin K
94872e00a5
refactor(Arg): changes Arg::short to accept a char instead of &str
Closes #1303
2018-07-23 15:10:12 -04:00
Kevin K
ab8c97e3f1
chore: relicense under MIT and APACHE 2.0 2018-07-23 14:25:18 -04:00
Dylan DPC
6a99e638f7 Fix assert_cli url
Even though github redirects to the correct url, it is better to mention the correct one 😄
2018-06-30 19:33:58 -04:00
Simon Egersand
30e6cd192a Fix formatting in README 2018-06-30 19:33:43 -04:00
Katharina
919fd32dfb
Moving the line into the apropriate section 2018-03-19 17:11:57 -04:00
Kevin K
e1d1c06d45
chore: updates version sync in readme 2018-02-09 23:40:55 -05:00
Kevin K
300a059f51
chore: updates the version tests 2018-02-03 15:22:56 -05:00
Kevin K
df996822c8 chore: increase version 2018-01-16 15:01:53 -05:00
Kevin K
3fef176543 docs: fixes typo in docs version 2018-01-09 12:07:19 -05:00
Kevin K
92caafaf51 chore: increase version 2018-01-09 11:08:47 -05:00
Romain Vimont
d954b3c734 Update default features in README
Since commit ac97edde90, feature
"wrap_help" is not enabled by default.

Update the README accordingly.
2017-12-05 13:55:57 +01:00
Kevin K
e962f2cece
chore: increase version 2017-12-02 15:34:02 -05:00
Kevin K
58a57d901b
chore: increase version 2017-11-28 08:57:04 -05:00
Kevin K
ce6ca492c7
docs: changes the demo version to 2.28 to stay in sync 2017-11-28 04:38:37 -05:00
Kevin K
9ef3d82bd0
chore: increase version 2017-11-27 10:28:28 -05:00
Kevin K
db6caf8663 docs(README.md): updates the readme and pulls out some redundant sections 2017-11-02 23:15:02 -04:00
Kevin K
67170a8bd7
chore: increase version 2017-10-26 10:09:48 -04:00
Kevin K
385596f6f6 chore: fix copy paste typo 2017-10-24 21:50:19 -04:00
Kevin K
3a471b72ce
docs: fixes some typo mistakes 2017-10-24 20:30:11 -04:00
Kevin K
e3eaf56b36
chore: increase version 2017-10-24 15:31:33 -07:00
Kevin K
3224e2e1cd Merge pull request #1051 from malbarbo/master
make vec_map optional
2017-10-03 21:49:01 -04:00
Marco A L Barbosa
d7a9f324b9 Add vec_map feature to README.md 2017-10-02 15:56:55 -03:00
Martin Geisler
e09c248fc1 tests: ensure README version numbers are in sync 2017-09-23 12:45:50 +02:00
Martin Geisler
5536361bcd docs: sync README version numbers with crate version 2017-09-23 12:32:49 +02:00
Kevin K
f093b4c1f8
chore: increase version 2017-09-14 10:39:24 -07:00
Kevin K
cbd813c1a0
chore: increase version 2017-09-13 20:55:00 -07:00
Manuel Reinhardt
9d089c1cc0 Fix small typo in Readme 2017-08-08 19:34:31 +02:00
Kevin K
517276c6f3
chore: increase version 2017-07-29 15:29:39 -04:00
Kevin K
76869a0d68 chore: fix increase version 2017-07-21 09:59:01 -04:00
Kevin K
00f8d28ab4 chore: increase version 2017-07-21 09:56:06 -04:00
Kevin K
e27a6ffbde chore: increase version
* chore: disables mention-bots finding reviewers and pinging tons of people

* docs(README.md): added a warning about using ~ deps

* chore: increase version
2017-06-19 22:57:54 -04:00
Kevin K
821929b51b docs(README.md): added a warning about using ~ deps
Closes #964
2017-05-29 13:10:55 -04:00
Kevin K
2923515a0a chore: increase version' 2017-05-16 07:23:22 -04:00
Kevin K
c556b39fd0 chore: increase version 2017-05-07 10:46:03 -04:00
Kevin K
bd4dbb4214 chore: increase version 2017-05-05 18:59:32 +02:00
Kalwyn Solork
fa34deac07 docs(README.md): fix some typos 2017-04-22 23:11:53 +02:00
Kevin K
2572150558
chore: increase version 2017-04-18 23:19:24 -04:00
Kevin K
f842e8fcec
chore: increase version 2017-04-09 14:40:43 -04:00
Kevin K
6095f239ba chore: increase version 2017-04-05 10:59:55 -04:00
Kevin K
cdae4fdf89 chore: increase version 2017-04-05 01:09:16 -04:00
Kevin K
8bcc4d632c chore: increase version 2017-03-30 13:35:36 -04:00
Kevin K
f922b05178 chore: increase version 2017-03-24 11:27:23 -04:00
Kevin K
cc1985b6d8
chore: increase version 2017-03-22 20:29:40 -04:00
Kevin K
0b4177f151
chore: increase version 2017-03-22 20:23:55 -04:00
Kevin K
8034fe70f2
chore: increase version 2017-03-18 17:06:43 -04:00
Kevin K
684aa99ee0
chore: increase version 2017-03-16 21:50:26 -04:00
Kevin K
e7c2eafb26
chore: increase version 2017-03-12 12:56:23 -04:00
Kevin K
c53e273c7c
chore: updates the changelog and readme with .last(true) details 2017-03-11 12:14:54 -05:00
Kevin K
e802a472de
docs(CHANGELOG.md): adds the details about ability to change the help message for the auto-generated help/version 2017-03-10 08:29:57 -05:00
Kevin K
06e07ad8e6
docs(README.md): removes the old updates from previous versions as it's getting very long and hard to read 2017-03-10 08:24:29 -05:00
Kevin K
a2e31b27b0
chore: increase version 2017-03-10 08:24:29 -05:00
Anthony Ramine
f4939ad560 Remove direct dependency on libc
It's not actually used anymore anywhere.
2017-03-05 19:44:16 +01:00
Kevin K
9626a1fbe7
chore: increase version 2017-02-18 11:44:38 -05:00
Kevin K
31a6b17a92
chore: increase version 2017-02-15 11:06:48 -05:00
Kevin K
92919f5f67 Call this PR "Raid" cause it's squashin bugs! (#843)
* tests: adds tests for default values triggering conditional requirements

* fix: fixes a bug where default values should have triggered a conditional requirement but didnt

Closes #831

* tests: adds tests for missing conditional requirements in usage string of errors

* fix: fixes a bug where conditionally required args werent appearing in errors

* tests: adds tests for completion generators

* tests: adds tests for completions with binaries names that have underscores

* fix: fixes a bug where ZSH completions would panic if the binary name had an underscore in it

Closes #581

* fix: fixes bash completions for commands that have an underscore in the name

Closes #581

* chore: fix the category for crates.io

* docs(Macros): adds a warning about changing values in Cargo.toml not triggering a rebuild automatically

Closes #838

* fix(Completions): fixes a bug where global args weren't included in the generated completion scripts

Closes #841

* fix: fixes a println->debugln typo

* chore: increase version
2017-02-03 17:43:49 -05:00
Kevin K
07d985d8c5 Issues 839,840 (#842)
* fix: fixes a critical bug where subcommand settings were being propogated too far

Closes #832

* imp: adds ArgGroup::multiple to the supported YAML fields for building ArgGroups from YAML

Closes #840

* chore: increase version
2017-02-03 15:46:25 -05:00
Kevin K
75e815aa3a chore: increase version (#837) 2017-01-30 20:55:02 -05:00
Kevin K
8e2e7448e9
chore: increase version 2017-01-29 21:24:40 -05:00