Commit graph

2510 commits

Author SHA1 Message Date
Oleksii Filonenko
1e39967044
Fix some clippy lints
- Manually fix some problems
- Run 'cargo fix --clippy'

Commits taken from similar PRs open at that time:

- Replace indexmap remove with swap_remove
  Resolves #1562 and closes #1563
- Use cognitive_complexity for clippy lint
  Resolves #1564 and closes #1565
- Replace deprecated trim_left_matches with trim_start_matches
  Closes #1539

Co-authored-by: Antoine Martin <antoine97.martin@gmail.com>
Co-authored-by: Brian Foley <bpfoley@users.noreply.github.com>
2019-10-29 21:46:25 -04:00
fvkramer
4e1da91fb1
examples: Change flag arg to option arg
Comments in 04_using_matches.rs list the config arg
as an optional arg. However, -c --config is currently
a flag arg. This commit sets takes_value to true on
the config arg to make it an "option" argument.
2019-10-29 21:45:58 -04:00
Sascha Grunert
b6ebdba2e1
Fix opts variable name in README.md 2019-10-29 21:45:47 -04:00
Tobias Kunze
ed69a688ff
Fix some typos in the docs 2019-10-29 21:45:09 -04:00
Oleksii Filonenko
1906c504ea
Replace ONCE_INIT with Once::new()
Deprecated since 1.38.0
2019-10-29 21:44:38 -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
Yuki Okushi
28a3abdd16
chore: fix cache issue on Travis 2019-10-29 21:43:04 -04:00
Dylan DPC
57cb4d2f83
Merge pull request #1525 from demoray/patch-1
use std::sync::Once::new() rather than ONCE_INIT
2019-10-21 08:30:46 +02:00
Dylan DPC
398b9dc6cc
Merge pull request #1534 from Eijebong/strsim
Update strsim to 0.9
2019-08-26 14:25:02 +02:00
Bastien Orivel
ece3f66e0f Update strsim to 0.9 2019-08-25 13:03:03 +02:00
Dylan DPC
ee808f464f
Update 17_yaml.yml 2019-07-25 12:14:05 +02:00
demoray
7f835ed24d
use std::sync::Once::new() rather than ONCE_INIT
Updated to v3-master per discussion on #1521
2019-07-23 10:03:07 -04:00
Dylan DPC
180b6b82de
Merge pull request #1520 from nootanghimire/style/add-newline-after-printing-help
style(help): add newline after writing help
2019-07-23 12:35:19 +02:00
Nootan Ghimire
a87284020f
style(help): add newline after writing help 2019-07-17 10:44:14 +10:00
Dylan DPC
eb6276c772
Merge pull request #1514 from rharriso/pattern-arg-suggestion
Pattern arg suggestion
2019-07-04 15:33:53 +02:00
Dylan DPC
7ea767ad39
Merge pull request #1509 from jeremystucki/refactoring
Minor Refactoring
2019-07-02 09:28:41 +02:00
Ross Harrison
ebfe225af3 refactor(Parser,Errors): refactor(Parser,Errors): Update unknown_argument function to take option
Update unknown_argument function to take option
2019-07-01 11:25:46 -05:00
Ross Harrison
8d953cab08 feat(Errors): Add Pattern suggestion to Unknown Arg Error Message 2019-07-01 11:01:11 -05:00
Dylan DPC
845a1ce4ed
Merge pull request #1511 from TyPR124/fixup-tests
Fixup tests
2019-06-26 17:28:51 +02:00
Tyler Ruckinger
a5e3e62bef test in mkeymap does not need #[should_panic] 2019-06-25 19:51:12 -04:00
Tyler Ruckinger
83b0ab5064 Fixup tests 2019-06-25 19:02:53 -04:00
Dylan DPC
b5af579c0b
Merge pull request #1508 from rivy/fix.yaml-require-equals
fix: add 'require_equals' support to YAML parsing
2019-06-25 11:22:55 +02:00
Roy Ivy III
89f8cc6929 fix: add 'require_equals' support to YAML parsing 2019-06-23 11:37:22 -05:00
Jeremy Stucki
9e10c45505
Use map instead of 'if let' 2019-06-21 09:54:19 +02:00
Jeremy Stucki
0f6ffe3612
Remove needless lifetimes 2019-06-21 09:06:58 +02:00
Jeremy Stucki
c6327bc22f
Use initialization shorthand 2019-06-21 09:06:06 +02:00
Jeremy Stucki
c5c64d48b7
Use map_or instead of match 2019-06-21 09:04:54 +02:00
Jeremy Stucki
5ff2bb4dcf
Use map instead of match on Option 2019-06-21 09:02:33 +02:00
Dylan DPC
699ad67567
Merge pull request #1500 from erickt/fix-build
Fix building v3-master
2019-06-20 17:08:44 +02:00
Erick Tryzelaar
cacc23473c Remove v2 depecated features.
This patch:

* Removes the `ArgSettings::Global` variant, and replaces all
  users of it to `Arg::global(...)`. The variant itself is lifted up
  into a field on Arg. This was deprecated in clap 2.32.0.
* Removes AppFlags::PropagateGlobalValuesDown. This was deprecated in
  clap 2.27.0.
* Removes `Arg::empty_values`. This was deprecated in clap 2.30.0.
* Removes `ArgMatches::usage`. This was deprecated in clap 2.32.0.
2019-06-19 17:04:29 -07:00
Erick Tryzelaar
4a20c6aaef Fix compiling with "--features yaml" 2019-06-19 16:32:52 -07:00
Erick Tryzelaar
fb138ab44c Disable testing yaml for now
v3-master's yaml feature has been broken for some time. Disable it
for now to get the builds back to green.
2019-06-19 15:49:01 -07:00
Erick Tryzelaar
2664703587 Fix most warnings
This patch:

* Removes unused `App::contains_long`
* Removes `std::ascii::AsciiExt` (deprecated in 1.26)
* Replaces `trim_left_matches` with `trim_start_matches` (added in 1.30)
* Adds `dyn` (added in 1.27)
* Removes unused `mkeymap::KeyType::{is_short,is_long}`
* Cleans up unused imports
2019-06-19 15:47:50 -07:00
Erick Tryzelaar
2e2616b59e Fix compiling on windows
This fixes compilation errors when building clap targetting windows with:

```
% rustup run nightly cargo check --target x86_64-pc-windows-msvc
```
2019-06-19 15:47:50 -07:00
Erick Tryzelaar
d4cd4896dd Bump minimum supported version of Rust to 1.33 2019-06-19 11:21:11 -07:00
Kevin K
0568dbd741
Merge pull request #1442 from arjunkathuria/v3-master
chore: bump the version for textwrap crate from 0.10 to 0.11
2019-04-05 21:15:32 -04:00
Kevin K
388f162646
Merge pull request #1446 from clap-rs/v3-dev
v3 Dev Rollup
2019-04-05 20:41:55 -04:00
Kevin K
46e81ca0b9
perf: only propagates to a single subcommand instead of all subcommands 2019-04-05 20:21:36 -04:00
Kevin K
958437661a
chore: clippy fixes 2019-04-05 20:21:34 -04:00
Kevin K
fcbae1574a
style: rustfmt run 2019-04-05 20:21:33 -04:00
Kevin K
573b0a9e88
chore: upgrades to 2018 edition of Rust 2019-04-05 20:21:30 -04:00
Kevin K
f0d6278685
refactor: fixes benches to the new fewer required lifetime parameter 2019-04-05 20:21:27 -04:00
Kevin K
4cc85990fd
refactor: removed strings as an internal ID for arguments, groups, and
subcommands

This commit changes the internal ID to a u64 which will allow for
greater optimizations down the road. In addition, it lays the ground
work for allowing users to use things like enum variants as argument
keys instead of strings.

The only downside is each key needs to be hashed (the implementation
used is an FNV hasher for performance). However, the performance gains
in faster iteration, comparison, etc. should easily outweigh the single
hash of each argument.

Another benefit of if this commit is the removal of several lifetime
parameters, as it stands Arg and App now only have a single lifetime
parameter, and ArgMatches and ArgGroup have no lifetime parameter.
2019-04-05 20:21:22 -04:00
Kevin K
2b283f6e51
wip: docs reminders 2019-04-04 13:28:32 -04:00
Kevin K
3dffd4908c
Removing the lint features and invoking cargo clippy manually instead 2019-04-04 13:27:08 -04:00
Kevin K
3f2a85ef15
Fix Travis CI badge 2019-04-04 13:24:24 -04:00
Kevin K
d2fbc41060
Cargo.toml: Fix typos in description 2019-04-04 13:22:29 -04:00
Erich Gubler
ab65a0200d
Use $crate prepend to make importing the _clap_count_exprs macro unnecessary 2019-04-04 13:21:28 -04:00
Kevin K
e798fec73b
fix(SPONSORS.md): fixes Josh Triplett's info in the sponsor document 2019-04-04 13:20:26 -04:00