Commit graph

268 commits

Author SHA1 Message Date
Ed Page
5be61a199c docs(examples); Call out optional subcommands 2022-04-01 09:27:29 -05:00
shir0kamii
fb4755d1c3 feat(derive): Don't abort when non-unit variant is skipped 2022-03-31 18:49:21 +02:00
shir0kamii
ee3d12ec56 fix(derive): Abort on non-unit variant 2022-03-30 03:49:14 +02:00
Ed Page
731d18f300 docs(examples): Fix help output 2022-03-25 07:20:46 -05:00
Ed Page
429e1d3f31 docs: Fix examples
CI didn't run for #3570, so we missed that some things were off on
Windows.
2022-03-23 12:31:13 -05:00
Ed Page
db863de6c1 docs(examples): Show how to do default subcommands
While we don't have a built-in mechanism, its relatively easy to support
with the APIs we provide.

Inspired by #3566
2022-03-23 11:08:07 -05:00
Ed Page
bdd5cf17f8 docs(examples): Show IP Address 2022-03-14 09:53:31 -05:00
Ed Page
4842f07045 docs(examples): Show duration parsing 2022-03-14 09:49:46 -05:00
Ed Page
c230c72120 docs(examples): Allow any path 2022-03-14 09:46:33 -05:00
Ed Page
ce9e2cba8f docs(examples): Show implicit parser 2022-03-14 09:43:17 -05:00
Ed Page
a8ffebbab9 docs(examples): Generalize key-value example 2022-03-14 09:38:04 -05:00
Ed Page
dbe8c0c957 docs(tutorial): Prefer custom parsing to validation 2022-03-14 09:31:40 -05:00
Matt Fellenz
17193bd074
docs(derive): Builder/Derive interop reference (#3515)
Fixes #3500
2022-03-07 14:43:51 -06:00
Jörg Wunderlich-Pfeiffer
92e1666868 docs: Fix link to example 2022-03-06 11:05:23 +01:00
Pavan Kumar Sunkara
8a9403a1df Fixes #3464 2022-03-05 14:25:12 +00:00
Ed Page
14ea156218 docs: Annotate more places with required features 2022-03-03 12:32:29 -06:00
Ed Page
d2863a228c
Merge pull request #3529 from epage/attrib
docs(derive): Shift structure around lang->builder
2022-03-02 18:18:34 -06:00
Lucas Kent
0fe8ca7d3c docs(derive): Shift structure around lang->builder
Before, we had the focus on attributes and how they were impacted by
various features.  Now we separate out language items and put both magic
and raw attributes under the type of attribute (command, arg, etc)
2022-03-02 16:14:51 -06:00
Steve Klabnik
f89c8f4da2 Fix a typo in an example 2022-03-02 08:41:08 -06:00
Moritz Mœller
22efb36983
Fixed broken Command Attributes link 2022-02-24 13:39:53 +01:00
Nils Homer
c13cd89ceb
Fix link to contributing 2022-02-22 20:36:54 -08:00
Ed Page
a7b7d43582 docs(derive): Call out 'Command' relationship 2022-02-22 18:09:47 -06:00
Ed Page
cb9cb251a9 style: Clean up 2022-02-22 17:47:46 -06:00
Ed Page
f7419ec3d2 docs(examples): Be explicit about example topics 2022-02-22 08:43:33 -06:00
Ed Page
c55989459f docs(tutorial): Examples as next step 2022-02-22 08:37:13 -06:00
Ed Page
7e51f7c03d docs(derive): Call out different subcommand arg syntaxes 2022-02-22 08:32:18 -06:00
Ed Page
517b8e4233 docs(derive): Clarify the break down 2022-02-22 08:31:02 -06:00
Ed Page
9946579fc9 docs(tutorial): Clarify to debug_assert in tests 2022-02-22 08:29:53 -06:00
Ed Page
3eee9add96 docs(derive): Add tip about derive reference
One of the concerns in #3490 was the finding of derive reference. Having
it at the end for a "next step" seems appropriate.
2022-02-22 08:27:35 -06:00
Ed Page
e8218733c2 docs(derive): Clarify subcommand arg syntax 2022-02-22 08:23:58 -06:00
Ed Page
bc2be89f46 docs(example): Remove builder references
Fixes #3489
2022-02-18 10:50:49 -06:00
Ed Page
976f3d500a
Merge pull request #3473 from epage/derive
fix: Change `IntoApp::into_app` to `CommandFactory::command`
2022-02-15 09:33:44 -06:00
Ed Page
360c4d6b8a docs: Update to new command! macro 2022-02-15 08:54:59 -06:00
Ed Page
ddac492302 fix: Rename IntoApp to CommandFactory
This is part of the `App` rename.

Previously, I was concerned about not being able to deprecate

For backwards compatibility, we still expose the `IntoApp` name.
2022-02-15 08:24:00 -06:00
Ed Page
c3fec1fa75 fix: Update derive->Command function name
No good solution for transitioning the trate name, unfortnately, since
we can't mark `use`s as deprecated (we can, it just does nothing).

I got rid of the `into` prefix because that implies a `self` parameter
that doesn't exist.
2022-02-14 16:04:10 -06:00
Ed Page
e8010e79a9 refactor: Update app variables to cmd 2022-02-14 15:55:56 -06:00
Ed Page
c4144d7d6c docs: Update App references to Command 2022-02-14 15:33:49 -06:00
Ed Page
3475555de6 fix(help): Use standard alternate syntax for subcommands 2022-02-14 21:18:33 -06:00
Ed Page
9a83ada940 fix(help): Separate subcommand flags 2022-02-14 16:20:33 -06:00
Ed Page
8c5e42e0fb fix(help): Show subcommand flags in same order as usage 2022-02-14 16:20:03 -06:00
Ed Page
adb2b03890 docs(examples): Show pacman-style help
Looking at how `App::usage` member is used, and didn't realize we had
this special logic.
2022-02-14 12:22:01 -06:00
Ed Page
97e36451cf docs: Update stale references to AppSettings 2022-02-11 15:58:12 -06:00
Ed Page
8f201d8dd6 docs: Stop demonstrating SubcommandRequiredElseHelp 2022-02-11 15:01:02 -06:00
Ed Page
06d43a02da fix(help): Subcommand help looks like --help
Like was said in #2435, this is what people would expect.

While we should note this in a compatibility section in the changelog, I
do not consider this a breaking change since we should be free to adjust
the help output as needed.  We are cautious when people might build up
their own content around it (like #3312) but apps should already handle
this with `--help` so this shouldn't be a major change.

We aren't offering a way for people to disable this, assuming people
won't need to.  Longer term, we are looking at support "Actions" (#3405)
and expect those to help customize the flags.  We'll need something
similar for the `help` subcommand.

Fixes #3440
2022-02-11 12:47:34 -06:00
Ed Page
272f840178 feat: Replace core set of AppSettings with functions
This is a part of #2717

Some settings didn't get getters because
- They are transient parse settings (e.g. ignore errors)
- They get propagated to args and should be checked there

`is_allow_hyphen_values_set` is a curious case.  In some cases, we only
check the app and not an arg.  This seems suspicious.
2022-02-11 12:35:09 -06:00
Ed Page
f00f97c8c4 docs(examples): Add missing feature flag reqs 2022-02-11 07:07:03 -06:00
Ed Page
47d76742eb feat: Add Arg getters for all settings
This is prep for #2717
2022-02-10 10:18:41 -06:00
josh rotenberg
ee3eab1614 docs(tutorial): Demonstrate custom parsing
Adds a more in depth validator to validate that the port is in range in the derive and builder tutorial (section 4.2).

This supersedes #3416
2022-02-09 09:16:57 -06:00
Ed Page
06b6714a48 docs(contrib): Call out parallel tutorials 2022-02-08 07:08:14 -06:00
Ed Page
5290f82133 feat: Override DeriveDisplayOrder behavior with App::next_display_order
For the derive API, you can only call `next_display_order` when dealing
with a flatten.  Until we offer app attributes on arguments, the user can workaround with
this no-op flattens.

This is a part of #1807
2022-02-07 19:19:11 -06:00