Commit graph

565 commits

Author SHA1 Message Date
Ed Page
37f2efb0bd perf: Vendor textwrap parts we need
The immediate benefit is binary size but this also makes us more
flexible on the implementation, like allowing wrapping of `StyledStr`.

This removed 12 KiB from `.text`

This helps towards #1365 and probably #2037
2022-08-25 09:50:54 -05:00
Ed Page
735d6fd1e3 refactor: Extract our own display width
This added about 4 KiB to `.text` which makes sense since we duplicated
logic.
2022-08-24 18:19:03 -05:00
Ed Page
c9d883a8c6 refactor: Remove once_cell dependency 2022-08-22 16:07:14 -05:00
Ed Page
fc499ac0ec perf: Let users choose Str implementation
The binary size and performance difference is enough to make it
configurable.

Code size:
- default: 565.7 KiB
- perf: 578.5 KiB

Build time:
- default: 9.1706 us
- perf: 7.0479 us

Parse time:
- default: 12.673 us
- perf: 8.1708 us

Parse with subcommand time:
- default: 12.112 us
- perf: 7.9874 us
2022-08-22 15:47:21 -05:00
Ed Page
429143af42 fix: Remove once_cell dependency from derive
With being able to accept owned types now, `clap_derive` no longer needs
`once_cell` to make dynamic data static.

This helps towards #1365, #2037
2022-08-16 15:03:35 -05:00
Ed Page
9c9cc9fcff docs(cookbook): Add position-sensitive example 2022-08-15 10:59:05 -05:00
Ed Page
6e7fd6d4bc refactor: Move off of IndexMap/HashMap
This dropped 17KB

Again, performance shouldn't be too bad as the total number of argument
id's passed in by the user shouldn't be huge, with the upper end being
5-15 except for in extreme cases like rustc accepting arguments from
cargo via a file.
2022-08-11 14:06:41 -05:00
Ed Page
1c06735390 chore: Update dependencies 2022-08-10 21:49:22 -05:00
Ed Page
3390adf0d3 chore: Bump MSRV to 1.60.0
While at it, this cleans up all of the features.  For some reason, I
couldn't do `dep:clap_derive` though.
2022-08-10 21:32:06 -05:00
Ed Page
22c82c7404 docs(tutorial): Further expand on actions 2022-08-09 16:33:02 -05:00
Ed Page
36777e7b6c docs(tutorial): Switch to hand-implemented ValueEnum 2022-08-09 10:23:23 -05:00
dependabot[bot]
0bf1627e05
chore(deps): bump terminal_size from 0.1.17 to 0.2.1
Bumps [terminal_size](https://github.com/eminence/terminal-size) from 0.1.17 to 0.2.1.
- [Release notes](https://github.com/eminence/terminal-size/releases)
- [Commits](https://github.com/eminence/terminal-size/compare/v0.1.17...v0.2.1)

---
updated-dependencies:
- dependency-name: terminal_size
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 07:04:43 +00:00
Ed Page
8aa7ab3e16 chore: Update version
The main goal is to reduce the risk of people developing on the wrong
release, assuming they are using something like starship to raise the
visibility of the crate version.
2022-07-23 21:43:37 -05:00
Ed Page
01a3ea425f fix!: Remove unstable-v4 feature gate 2022-07-22 11:34:06 -05:00
Ed Page
99d92c916c fix!: Remove yaml support 2022-07-21 12:46:47 -05:00
Ed Page
765af4198c fix!: Remove regex validation 2022-07-21 12:42:09 -05:00
Ed Page
d40e42a9ca chore: Release 2022-07-20 20:13:29 -05:00
Ed Page
e6b8b4b607 chore: Release 2022-07-19 14:41:47 -05:00
Ed Page
85ccf3e901 chore: Update release process 2022-07-19 14:41:42 -05:00
Ed Page
a8a7a61f56 chore: Release 2022-07-14 09:38:54 -05:00
Ed Page
2df0732df4 chore: Release 2022-07-13 09:08:35 -05:00
Ed Page
9b6321a1f0 chore: Release 2022-07-11 21:48:07 -05:00
Ed Page
074712a739 chore: Update release process 2022-07-11 21:47:35 -05:00
Ed Page
6614ffa6c8 chore: Release 2022-06-30 08:25:54 -05:00
Ed Page
b4a1362486 chore: Release 2022-06-28 08:04:18 -05:00
Ed Page
3c4e684c8b test: Verify auto-traits for core types
By checking these types, we'll get some other types for free, like
`Command` verifying `Arg`.

This was inspired by #3876
2022-06-27 20:50:29 -05:00
Ed Page
3823df9bbe chore: Release 2022-06-21 09:32:04 -05:00
Ed Page
ae78f88d48
Merge pull request #3852 from epage/msrv
chore: Bump MSRV from 1.56.0 to 1.56.1
2022-06-17 09:23:06 -05:00
Ed Page
82d70d82c4 chore: Bump MSRV from 1.56.0 to 1.56.1
Being a patch release, I'm fine doing this outside of a minor release.
This avoids us having to deal with indexmap having a higher MSRV.
2022-06-17 09:01:45 -05:00
Tshepang Mbambo
806f634bfa chore: trim Cargo manifest fields whose values are defaults
See...
- https://doc.rust-lang.org/cargo/reference/manifest.html?#the-documentation-field
- https://doc.rust-lang.org/cargo/reference/manifest.html?#the-readme-field
2022-06-17 15:49:04 +02:00
Ed Page
a7698e9a1d chore: Release 2022-06-15 11:50:16 -05:00
Ed Page
20358ff295 chore: Release 2022-06-14 15:01:42 -05:00
Ed Page
11fe3ce404 fix(derive): Allow opting in to the original deprecations 2022-06-14 14:26:34 -05:00
Ed Page
63a17a40ad chore: Release 2022-06-14 11:19:59 -05:00
Ed Page
7515bfeb51 fix: Allow people to opt-in to deprecations
This adds a new `Cargo.toml` feature named `deprecated` that opts
controls whether deprecation warnings show up.  This is starting off as
non-default though that may change (see below).

Benefits
- Allows a staged rollout so a smaller subset of users see new
  deprecations and can report their experience with them before everyone
  sees them.  For example, this reduces the number of people who have to
  deal with #3822.
- This allows people to defer responding to each new batch of
  deprecations and instead do it at once.  This means we should
  reconsider #3616.

The one risk is people who don't follow blog posts and guides having a
harder time upgrading to the next breaking release without the warnings
on by default.  For these users, we reserve the right to make the
`deprecated` feature `default`.  This is most likely to happen in a
minor release that is released in conjunction with the next major
release (e.g. when releasing 4.0.0, we release a 3.3.0 that enables
deprecations by default).  By using a feature, users can still disable
this if they want.

Thanks @joshtriplett for the idea
2022-06-14 10:50:05 -05:00
Ed Page
cb42df61e4 refactor: Switch to once_cell
Though this is changing an API item we export, we do not consider this a
breaking change because
- This was an implementation detail of the macros and people shouldn't be using it directly
- The `macro_rules` macro is coupled to `clap` because they are in the
  same crate
- The derive macro is coupled to `clap` because `clap` declares a
  `=x.y.z` dependency on `clap_derive

Fixes #3828
2022-06-14 09:10:50 -05:00
Ed Page
7836beda05 chore: Release 2022-06-14 07:02:40 -05:00
Ed Page
650a29c18b chore: Release 2022-06-13 09:37:47 -05:00
Ed Page
4e56acffce chore: Release 2022-06-13 09:31:29 -05:00
Ed Page
34368419c2 refactor(bench): Pull out benchmarks into own crate
This is mostly about avoiding criterion's build times when just
developing clap itself.

I'm assuming the derive test changed because criterion's clap v2 isn't
in the dependency tree anymore.
2022-06-03 13:51:26 -05:00
Ed Page
686b0379ce feat(multicall): Stablize multicall
`multicall` allows you to have one binary expose itself as multiple
programs, like busybox does.  This also works well for user clap for
parsing REPLs.

Fixes #2861
2022-05-20 12:20:40 -05:00
Ed Page
2abb6804d3 fix: Switch to 2021 edition 2022-05-18 10:35:30 -05:00
Ed Page
d827364ea9 style: Normalize manifests 2022-05-18 10:33:37 -05:00
Ed Page
4a733cd879 fix: Bump MSRV to 1.56.0
This is needed for `Bound::cloned` and fits within official MSRV policy
(2 versions back) and unofficial (6 months, see #3267)
2022-05-17 17:13:08 -05:00
Ed Page
524e36cf1a chore: Release 2022-05-10 15:29:16 -05:00
Liu Dingming
1b63fbd6df feat(derive): Start unstable-v4 feature flag
This is split out of #3661 as several changes I'm working on need it.
2022-05-06 14:56:55 -05:00
Ed Page
55e791e80e chore: Release 2022-05-06 11:57:48 -05:00
Ed Page
17b930c203 chore: Release 2022-05-05 21:04:09 -05:00
Ed Page
0240ec5493 chore: Release 2022-05-02 13:02:10 -05:00
Ed Page
ec4735a44e docs: Add REPL example
This is to help in cases like #3668 and #3673
2022-05-02 06:27:57 -05:00