Ed Page
6291289c0f
fix(lex): Make long args more convinient
2022-04-15 10:55:34 -05:00
Ed Page
e2865c91be
perf: Reduce allocations on 'args'
...
This seems like it'd have close to the same benefits as the suggestion
in the TODO, resolving it.
2021-10-18 16:14:31 -05:00
Ed Page
294cabf7c6
perf: Don't allocate a throw-away Vec
2021-10-18 16:14:31 -05:00
dylni
dc65513966
Replace ArgStr
with os_str_bytes::RawOsStr
2021-08-29 10:00:30 -04:00
ldm0
ddb53af5dc
Change some u64 to usize
2021-02-13 15:25:40 +00:00
Pavan Kumar Sunkara
c9cb22905c
Build help and version args at the beginning
2021-02-07 14:46:38 +00:00
Pavan Kumar Sunkara
a0269a41d4
Merge pull request #2268 from ldm0/fixme
...
Better mkeymap
2020-12-28 10:09:27 +00:00
Donough Liu
0f115f18ad
Fix positional count usage
2020-12-27 04:11:30 +08:00
Donough Liu
120e942e7a
Private arg
2020-12-27 01:46:48 +08:00
Donough Liu
2b7fd731ae
Private keys
2020-12-27 01:20:53 +08:00
Donough Liu
f54328ee4c
Cleaner api and better inner documentation
2020-12-27 00:43:49 +08:00
Donough Liu
ad3d3a13cd
KeyType: PartialEq for u64
2020-12-26 21:03:21 +08:00
Donough Liu
b2a066b24f
Resolve a fixme, better code readability
2020-12-26 21:03:21 +08:00
budde25
c26d1a4421
imp: added more derives to common App, Arg, and ArgMatches
2020-12-23 17:26:53 -06:00
Marti Raudsepp
cda89a2af1
Fix typos and grammar
...
Some more fixes in addition to 594c535ba2
* Some I noticed manually.
* Some were found by Topy (https://github.com/intgr/topy ), either new
rules from Typo or new code in clap.
* `etc.` and `e.g.` rules were disabled during the last run.
2020-10-10 16:22:05 +03:00
Pavan Kumar Sunkara
b931e25c79
Update MSRV to 1.42
2020-10-09 17:04:46 +02:00
CreepySkeleton
ccb1ea2d65
Remove useless code
...
This code does not serve any purpose as far as I can tell
2020-08-29 00:44:11 +03:00
CreepySkeleton
37c1631f06
Make lifetimes descriptive
2020-07-21 18:59:07 +03:00
CreepySkeleton
6810889879
Turn Option<Vec<T>> into Vec<T>
2020-05-13 05:53:17 +03:00
ConnorSkees
59f3e9414b
allow short aliases on Arg
...
this implements Arg::short_alias, Arg::short_aliases,
Arg::short_visible_alias, and Arg::short_visible_aliases in addition to
adding their associated tests
2020-05-11 11:21:01 -04:00
CreepySkeleton
c6fdd3a7ce
Reshape imports
2020-04-27 21:47:08 +03:00
CreepySkeleton
3e865e565f
A little cleanup
2020-04-25 15:57:12 +03:00
CreepySkeleton
823332e919
Handle publicity properly
2020-04-16 08:29:16 +03:00
CreepySkeleton
00f2a82c3e
Make debug output much more useful
2020-04-14 07:21:27 +03:00
CreepySkeleton
4fc4a00b8f
Remove _some_ of pubs
2020-03-19 10:17:52 +03:00
CreepySkeleton
329bfa9895
Get rid of extra scopes
2020-03-09 21:08:15 +03:00
Pavan Kumar Sunkara
33f47acc67
Refactor clap_generate
2020-02-07 07:52:04 +01:00
Pavan Kumar Sunkara
8e4a189ab0
fmt: Use standardized rustfmt rules
2020-01-31 18:37:56 +01:00
danieleades
af45420027
style: format code with rustfmt ( #1632 )
...
> incidentally, how do we feel about adding a rustfmt check to the CI(s)?
yes we should be doing that. you can send another pr that adds the check to the Ci
2020-01-11 23:45:46 +05:30
Jeremy Stucki
2e1acb648c
Refactor mkeymap ( #1618 )
...
* refactor(mkeymap): Use iterators
* refactor(mkeymap): Implement contains method
* refactor(mkeymap): Deprecate methods
Co-authored-by: Dylan DPC <dylan.dpc@gmail.com>
2020-01-09 23:00:22 +05:30
Dylan DPC
dd6c8e08ad
use 2018 edition and minor refactors
2019-11-11 12:54:55 +01:00
Tyler Ruckinger
a5e3e62bef
test in mkeymap does not need #[should_panic]
2019-06-25 19:51:12 -04: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
Kevin K
958437661a
chore: clippy fixes
2019-04-05 20:21:34 -04:00
Kevin K
573b0a9e88
chore: upgrades to 2018 edition of Rust
2019-04-05 20:21:30 -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
eafee3c5c1
style: cargo fmt run
2018-11-14 14:01:48 -05:00
Kevin K
2a480451d3
refactor: clippy run
2018-11-14 14:01:48 -05:00
Kevin K
20c72525d2
style: cargo fmt run
2018-11-14 12:05:06 -05:00
Kevin K
0de9e07412
Merge branch 'v3-master' into map
2018-11-13 22:07:16 -05:00
Kevin K
99bd101ea7
tests: fixes did_you_mean tests
2018-08-27 21:44:09 -04:00
Kevin K
400fafade2
tests: fixes help tests
2018-08-27 20:25:37 -04:00
Kevin K
d90186d3bb
tests: fixes mkeymap tests
2018-08-20 20:28:51 -04:00
Kevin K
6c5d4c5896
tests: fixes the app_settings tests
2018-08-20 20:23:52 -04:00
Alena Yuryeva
b48ef85ece
fixed unique_args tests
2018-08-11 21:32:06 +03:00
Alena Yuryeva
c501773ed3
Tests on flags passing
2018-08-11 20:34:40 +03:00
Alena Yuryeva
87c88d6054
Arg-specific API for MKeyMap
2018-08-04 18:37:35 -04:00
Kevin K
a75b67838e
refactor(Suggestions): changes from string slice to owned string for return values
...
The return value is only used in the error case, and only a single
String allocation, therefore the complexities introduced by using string
slices isn't worth it. clap primarily only needs to be as fast as
possible in the happy path, the error path can afford additional
allocations.
2018-08-04 18:34:54 -04:00
Alena Yuryeva
272170e333
WIP
2018-08-04 18:32:08 -04:00
Alena Yuryeva
f230cfedc3
WIP
2018-08-04 18:26:33 -04:00