cargo-outdated icon indicating copy to clipboard operation
cargo-outdated copied to clipboard

Update clap to v3.1

Open CosmicHorrorDev opened this issue 3 years ago • 2 comments
trafficstars

This updates clap to the v3.1.6 derive API. Do note that this will require an MSRV bump up to 1.54.0 since that's the minimum that any of the clap v3 versions require.

The updated CLI should match the existing one (all the tests pass :tada:). Here is the old vs new help page for comparison. As you can see things are the same aside from some very small differences like the options being sorted by the short name instead of long, a different default wrap length, and the use of color (can't be seen from just the text of course)

Old

cargo-outdated 0.11.0
Displays information about project dependency versions

USAGE:
    cargo outdated [OPTIONS]

OPTIONS:
    -a, --aggresssive                  Ignores channels for latest updates
        --color <COLOR>                Output coloring [default: auto]  [possible values: Auto, Never, Always]
    -d, --depth <NUM>                  How deep in the dependency chain to search (Defaults to all dependencies when
                                       omitted)
    -x, --exclude <DEPENDENCIES>...    Dependencies to exclude from building (comma separated or one per '--exclude'
                                       argument)
        --exit-code <NUM>              The exit code to return on new versions found [default: 0]
        --features <FEATURES>...       Space-separated list of features
        --format <FORMAT>              Output formatting [default: list]  [possible values: List, Json]
    -h, --help                         Prints help information
    -i, --ignore <DEPENDENCIES>...     Dependencies to not print in the output (comma separated or one per '--ignore'
                                       argument)
    -e, --ignore-external-rel          Ignore relative dependencies external to workspace and check root dependencies
                                       only.
    -m, --manifest-path <PATH>         Path to the Cargo.toml file to use (Defaults to Cargo.toml in project root)
    -o, --offline                      Run without accessing the network (useful for testing w/ local registries)
    -p, --packages <PKGS>...           Packages to inspect for updates (comma separated or one per '--packages'
                                       argument)
    -q, --quiet                        Suppresses warnings
    -r, --root <ROOT>                  Package to treat as the root package
    -R, --root-deps-only               Only check root dependencies (Equivalent to --depth=1)
    -V, --version                      Prints version information
    -v, --verbose                      Use verbose output
    -w, --workspace                    Checks updates for all workspace members rather than only the root package

New

cargo-outdated-outdated 0.11.0
Displays information about project dependency versions

USAGE:
    cargo-outdated outdated [OPTIONS]

OPTIONS:
    -a, --aggressive                Ignores channels for latest updates
        --color <COLOR>             Output coloring [default: auto] [possible values: auto, never,
                                    always]
    -d, --depth <NUM>               How deep in the dependency chain to search (Defaults to all
                                    dependencies)
    -e, --ignore-external-rel       Ignore relative dependencies external to workspace and check
                                    root dependencies only
        --exit-code <NUM>           The exit code to return on new versions found [default: 0]
        --features <FEATURES>       Space-separated list of features
        --format <FORMAT>           Output formatting [default: list] [possible values: list, json]
    -h, --help                      Print help information
    -i, --ignore <DEPENDENCIES>     Dependencies to not print in the output (comma separated or one
                                    per '--ignore' argument)
    -m, --manifest-path <PATH>      Path to the Cargo.toml file to use (Default to Cargo.toml in
                                    project root)
    -o, --offline                   Run without accessing the network (useful for testing w/ local
                                    registries)
    -p, --packages <PKGS>           Packages to inspect for updates (comma separated or one per
                                    --packages' argument)
    -q, --quiet                     Suppresses warnings
    -r, --root <ROOT>               Package to treat as the root package
    -R, --root-deps-only            Only check root dependencies (Equivalent to --depth=1)
    -v, --verbose                   Use verbose output
    -V, --version                   Print version information
    -w, --workspace                 Checks updates for all workspace members rather than only the
                                    root package
    -x, --exclude <DEPENDENCIES>    Dependencies to exclude from building (comma separated or one
                                    per '--exclude' argument)

CosmicHorrorDev avatar Mar 13 '22 20:03 CosmicHorrorDev

I see that this project is already on the 2021 edition so clap's MSRV requirement shouldn't be an issue

CosmicHorrorDev avatar Mar 13 '22 20:03 CosmicHorrorDev

Fixed the merge conflicts from more recent changes

CosmicHorrorDev avatar Jul 02 '22 19:07 CosmicHorrorDev

Rebased on master

kbknapp avatar Jan 22 '23 02:01 kbknapp

I apologize for the long (nearly a year) wait - I think my notifications for this repo were accidentally marked as read.

My plan is to merge this, then open another PR moving to clap v4. I'd prefer to do it in those steps than just jumping to v4 directly.

kbknapp avatar Jan 22 '23 02:01 kbknapp

Thanks for picking this up! I don't mind the wait

I think having separate updates for v3 and v4 makes sense

CosmicHorrorDev avatar Jan 22 '23 02:01 CosmicHorrorDev

bors r+

kbknapp avatar Jan 22 '23 03:01 kbknapp

Build succeeded:

bors[bot] avatar Jan 22 '23 03:01 bors[bot]