dylint icon indicating copy to clipboard operation
dylint copied to clipboard

Make the path argument to `cargo dylint upgrade` optional

Open smoelius opened this issue 2 years ago • 0 comments

Make this optional:

$ cargo dylint upgrade --help
Upgrade the library package at <PATH> to the latest version of `clippy_utils`

Usage: cargo-dylint dylint upgrade [OPTIONS] <PATH>
                                             ^^^^^^

Default to the current directory when PATH is not provide.

The changes that would be required are the following:

  • Change path's type from String to Option<String> in two places:
    • https://github.com/trailofbits/dylint/blob/d75ae91f34613a329a231797a0142066194b5f3d/cargo-dylint/src/main.rs#L128
    • https://github.com/trailofbits/dylint/blob/d75ae91f34613a329a231797a0142066194b5f3d/dylint/src/opts.rs#L110
  • Handle the case when path is None here: https://github.com/trailofbits/dylint/blob/d75ae91f34613a329a231797a0142066194b5f3d/dylint/src/package_options/mod.rs#L100

smoelius avatar Feb 03 '23 15:02 smoelius