Skip to content

Commit

Permalink
docs: Encourage CLI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Dec 6, 2021
1 parent f18f355 commit 7dfd1f2
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ you can set `App::help_heading`.

**From clap v2**

1. Update your dependency
1. Add CLI tests, `-h` and `--help` output at a minimum (recommendation: [trycmd](https://docs.rs/trycmd/) for snapshot testing)
2. Update your dependency
1. *If you use `no-default-features`:* add the `std` feature
2. Resolve compiler errors
3. Resolve behavior changes
3. Resolve compiler errors
4. Resolve behavior changes
1. Refactor your `App` creation to a function and add a test similar to the one below, resolving any of its assertions
2. Look over the "subtle changes" under BREAKING CHANGES
3. *If using builder:* test your application under various circumstances to see if `ArgMatches` asserts regarding `AllowInvalidUtf8`.
4. *At your leisure:* resolve deprecation notices
5. *At your leisure:* resolve deprecation notices

Example test:
```rust
Expand All @@ -61,14 +62,15 @@ fn verify_app() {

**From structopt 0.3.25**

1. Update your dependency, adding the `derive` feature flag
1. Add CLI tests, `-h` and `--help` output at a minimum (recommendation: [trycmd](https://docs.rs/trycmd/) for snapshot testing)
2. Update your dependency, adding the `derive` feature flag
1. *If you use `no-default-features`:* add the `std` feature
2. Resolve compiler errors, including
3. Resolve compiler errors, including
1. Update your `use` statements from `structopt` and `structopt::clap` to `clap`
3. Resolve behavior changes
4. Resolve behavior changes
1. Add a test similar to the one below, resolving any of its assertions
2. Look over the "subtle changes" under BREAKING CHANGES
4. *At your leisure:* resolve deprecation notices
5. *At your leisure:* resolve deprecation notices

Example test:
```rust
Expand All @@ -86,19 +88,20 @@ fn verify_app() {

**From clap v3.0.0-beta.5**

1. Update your dependency
1. Add CLI tests, `-h` and `--help` output at a minimum (recommendation: [trycmd](https://docs.rs/trycmd/) for snapshot testing)
2. Update your dependency
1. Add in `derive`, `env`, `cargo`, or `unicode` feature flags as needed
2. Resolve compiler errors
3. Resolve compiler errors
2. *If you use `yaml`, `clap_app!`, or usage parser:* revert any changes you made for clap3
2. Change `Arg::about` `Arg::long_about` back to `help` and `long_help` and change `PossibleValue::about` to `help` ([clap-rs/clap#2937](https://github.com/clap-rs/clap/discussions/2937))
3. Change `AppSettings::HelpRequired` to `AppSettings::HelpExpected`
4. Change `PossibleValue::hidden` to `PossibleValue::hide`
5. Change `App::subcommand_placeholder` to `App::subcommand_value_name` / `App::subcommand_help_heading`
3. Resolve behavior changes
4. Resolve behavior changes
2. Add the above listed test appropriate for your application and resolve any problems it reports
1. *If using `derive`:* see the structopt breaking changes section for `Vec` changes
3. *If using builder:* test your application under various circumstances to see if `ArgMatches` asserts regarding `AllowInvalidUtf8`.
4. *At your leisure:* resolve deprecation notices
5. *At your leisure:* resolve deprecation notices

### BREAKING CHANGES

Expand Down

0 comments on commit 7dfd1f2

Please sign in to comment.