Commit graph

110 commits

Author SHA1 Message Date
CreepySkeleton
e9759a241b Adjust examples and tests 2020-08-05 17:07:13 +03:00
João Marcos
24760bc261 style: replacing yml with yaml for consistency 2020-07-20 20:58:34 -03:00
Marti Raudsepp
594c535ba2 Fix various typos in docs & code
Most errors detected and fixed with Topy (https://github.com/intgr/topy),
all verified by hand.
2020-07-19 03:10:28 +03:00
NickHackman
21436398a2 docs: improved flag subcommand documentation
Improved documentation in flag subcommand example and in
`App::short_flag` and `App::long_flag` method documentation.
2020-07-16 17:48:00 -04:00
NickHackman
8a68f99750 example: more pacman-like and refractor
Removed user facing panics and improved ergonomics to behave more like
pacman behaves.
2020-07-07 21:26:38 -04:00
NickHackman
806d7487c6 example: updated 23 docs & refractor
Improved printing instead of printing out the `Vec` using `{:?}`,
`join(", ")` for improved printing. Improved documentation to b emore
explicit and apply to removal of `FlagSubCommand` -> `App::short_flag`
and `App::long_flag`
2020-06-16 20:01:19 -04:00
NickHackman
458736bee8 imp: Improved Flag Subcommand API
Instead of a `FlagSubCommand` struct the addition of two simple methods
to `App`. `App::long_flag` and `App::short_flag` that cover all the
bases of the many methods that were provided in `FlagSubCommand`. This
API is far simpler to use and more akin to the present `Arg::long` and `Arg::short`.
2020-06-15 21:52:36 -04:00
NickHackman
50829711ef examples: FlagSubCommand pacman
Using `pacman` as an example for `FlagSubCommand` because of #1361
2020-06-13 12:32:17 -04: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
kevinlmadison
195b6cb245 fix typo in example 04_using_matches.rs 2020-05-12 00:30:03 +02:00
CreepySkeleton
56fdfb9edd Eradicate warnings and errors: tests and examples 2020-05-02 23:33:47 +03:00
CreepySkeleton
ec6b6e1e36 Make validator take &str instead of String 2020-05-01 14:21:11 +03:00
creativcoder
92d5920748 Updated test and usage of older help APIs with about 2020-04-27 02:42:07 +05:30
Pavan Kumar Sunkara
dbe6ac01f6 Clean up arg_enum 2020-04-22 14:38:16 +02:00
CreepySkeleton
af95c2b6a4 Replace value_t*! macros with methods 2020-04-13 04:20:09 +03:00
CreepySkeleton
5d9ef1527f Fix warnings in tests & examples 2020-03-05 13:40:25 +03:00
bors[bot]
e4a7f50128
Merge #1669
1669: refactor: Rename Arg::conflicts_with_everything to Arg::exclusive (#1… r=pksunkara a=CreepySkeleton



Co-authored-by: Gregor Pfeifer <gpfeifer@dxc.com>
2020-02-22 21:58:29 +00:00
Pavan Kumar Sunkara
5b3a0dff9c Remove extern & macro_use where possible 2020-02-07 07:34:01 +01:00
Gregor Pfeifer
7781fd8813 refactor: Rename Arg::conflicts_with_everything to Arg::exclusive (#1583) (#1624)
https://github.com/clap-rs/clap/pull/1624#issuecomment-571372359
2020-02-04 18:02:47 +03:00
Alex van de Sandt
050bb7484a Fix formatting 2020-02-03 13:04:07 -05:00
Alex van de Sandt
e068826e62 Remove mention of macro_use in doc comment 2020-02-03 12:01:36 -05:00
Alex van de Sandt
81b8bdd7fc Remove #[macro_use] from examples 2020-02-03 12:01:36 -05: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
Gregor Pfeifer
6180d42c00 feat: Add Arg::conflicts_with_everything method #1583 (#1624)
* feat: Add `Arg::conflicts_with_everything` method #1583

* fix: Typo in  src/build/arg/mod.rs

Co-Authored-By: Dylan DPC <dylan.dpc@gmail.com>

Co-authored-by: Dylan DPC <dylan.dpc@gmail.com>
2020-01-06 00:16:28 +05:30
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
Dylan DPC
ee808f464f
Update 17_yaml.yml 2019-07-25 12:14:05 +02:00
Erick Tryzelaar
4a20c6aaef Fix compiling with "--features yaml" 2019-06-19 16:32:52 -07:00
Kevin K
fcbae1574a
style: rustfmt run 2019-04-05 20:21:33 -04:00
Kevin K
20c72525d2 style: cargo fmt run 2018-11-14 12:05:06 -05:00
Kevin K
441f539ede
Merge pull request #1370 from andrewmiller1/yaml-mismatched-types-char
Yaml mismatched types char
2018-11-08 20:37:44 -05:00
andrewmiller1
78886f917d update yaml example comments 2018-11-04 19:11:48 -06:00
Kevin K
03333800fe refactor: remove code going to other crates and deprecations 2018-10-19 23:31:06 -04:00
Kevin K
eaa0700e7e
style: rustfmt run 2018-08-01 23:13:51 -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
af3264d559 Merge pull request #1272 from bspeice/patch-1
examples: Method rename
2018-06-12 09:54:19 -04:00
Kevin K
3b633e68b1
Merge pull request #1258 from little-dude/warnings
Fix compilation warnings
2018-05-22 09:43:31 -04:00
Corentin Henry
dcf00b76eb fix unused import warning 2018-04-21 13:06:11 -07:00
Corentin Henry
4f602b7e86 replace Arg::from_usage by Arg::from 2018-04-21 11:59:19 -07:00
Kevin K
1ab10275e4
style: rustfmt run 2018-01-25 12:21:17 -05:00
discosultan
67e937acf7 Fix typo in 07_option_args.rs 2018-01-18 14:21:02 +01:00
discosultan
8aa3c57351 Fix typo in 07_option_args.rs 2018-01-18 14:16:15 +01:00
Jaanus Varus
354cefd274
Fix typos in 03_args.rs 2018-01-18 13:20:02 +01:00
Jaanus Varus
eb9269a23b
Fix doc typo in 14_groups.rs 2018-01-16 19:54:14 +01:00
Matt Kraai
cc341243f3
Fix typos 2018-01-10 21:49:40 -08:00
messense
2c86c8eb4c Make -- mandatory for the slop example 2017-07-21 09:39:24 -04:00
Dru Sellers
4824fccfb9 Add slop example 2017-06-10 17:38:53 -04:00
Guanqun Lu
34a7436dd3 trivial typo fixes 2017-05-11 20:52:35 -04:00
Martin Geisler
d6743bb70d Fix compilation warnings (#825)
* tests: remove unnecessary mut

When building the projec, I was told

    warning: variable does not need to be mutable, #[warn(unused_mut)]
    on by default
      --> tests/macros.rs:39:9
       |
    39 |     let mut app = clap_app!(("app name with spaces-and-hyphens") =>
       |         ^^^^^^^

* examples: remove unused variable

The inner Some value is not used in the match arm:

    warning: unused variable: `local_matches`,
    #[warn(unused_variables)] on by default
       --> examples/20_subcommands.rs:128:32
        |
    128 |                 ("local", Some(local_matches)) =>{
        |                                ^^^^^^^^^^^^^
2017-01-29 18:13:49 -08:00