Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump clap 3 -> 4 #226

Merged
merged 3 commits into from
Mar 7, 2024
Merged

bump clap 3 -> 4 #226

merged 3 commits into from
Mar 7, 2024

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Mar 7, 2024

Looks working. UI layout changed, but i guess this acceptable.

klensy added 3 commits March 7, 2024 11:51
$ cargo check --features clap/deprecated
warning: use of deprecated method `clap::Arg::<'help>::required_unless`: Replaced with `Arg::required_unless_present`
  --> crox\src\main.rs:47:12
   |
47 |     #[clap(required_unless = "dir")]
   |            ^^^^^^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated method `clap::Arg::<'help>::required_unless`: Replaced with `Arg::required_unless_present`
  --> crox\src\main.rs:47:12
   |
47 |     #[clap(required_unless = "dir")]
   |            ^^^^^^^^^^^^^^^

warning: use of deprecated associated function `clap::Parser::from_args`: `StructOpt::from_args` is replaced with `Parser::parse` (note the change in derives)
   --> crox\src\main.rs:138:20
    |
138 |     let opt = Opt::from_args();
    |                    ^^^^^^^^^

warning: use of deprecated associated function `clap::Parser::from_args`: `StructOpt::from_args` is replaced with `Parser::parse` (note the change in derives)
  --> mmview\src\main.rs:17:20
   |
17 |     let opt = Opt::from_args();
   |                    ^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated associated function `clap::Parser::from_args`: `StructOpt::from_args` is replaced with `Parser::parse` (note the change in derives)
  --> stack_collapse\src\main.rs:15:20
   |
15 |     let opt = Opt::from_args();
   |                    ^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated associated function `clap::Parser::from_args`: `StructOpt::from_args` is replaced with `Parser::parse` (note the change in derives)
  --> mmedit\src\main.rs:64:20
   |
64 |     let opt = Opt::from_args();
   |                    ^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `crox` (bin "crox") generated 3 warnings
warning: `mmview` (bin "mmview") generated 1 warning
warning: `stack_collapse` (bin "stack_collapse") generated 1 warning
warning: `mmedit` (bin "mmedit") generated 1 warning
warning: use of deprecated associated function `clap::Parser::from_args`: `StructOpt::from_args` is replaced with `Parser::parse` (note the change in derives)
  --> flamegraph\src\main.rs:16:20
   |
16 |     let opt = Opt::from_args();
   |                    ^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `flamegraph` (bin "flamegraph") generated 1 warning
warning: use of deprecated associated function `clap::Parser::from_args`: `StructOpt::from_args` is replaced with `Parser::parse` (note the change in derives)
   --> summarize\src\main.rs:315:20
    |
315 |     let opt = Opt::from_args();
    |                    ^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default
$ cargo check --features clap/deprecated
warning: use of deprecated function `<Opt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> crox\src\main.rs:47:7
   |
47 |     #[clap(required_unless_present = "dir")]
   |       ^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated function `<Opt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> crox\src\main.rs:50:7
   |
50 |     #[clap(long = "dir")]
   |       ^^^^

warning: use of deprecated function `<Opt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> crox\src\main.rs:53:7
   |
53 |     #[clap(long = "collapse-threads")]
   |       ^^^^

warning: use of deprecated function `<Opt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> crox\src\main.rs:56:7
   |
56 |     #[clap(long = "minimum-duration")]
   |       ^^^^

warning: use of deprecated function `<Opt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> mmview\src\main.rs:12:7
   |
12 |     #[clap(short = 't', long = "thread-id")]
   |       ^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `crox` (bin "crox") generated 4 warnings
warning: `mmview` (bin "mmview") generated 1 warning
warning: use of deprecated function `<Opt as clap::Subcommand>::augment_subcommands::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
  --> mmedit\src\main.rs:15:7
   |
15 |     #[clap(name = "truncate")]
   |       ^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `mmedit` (bin "mmedit") generated 1 warning
warning: use of deprecated function `<DiffOpt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> summarize\src\main.rs:28:7
   |
28 |     #[clap(short = 'e', long = "exclude")]
   |       ^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: use of deprecated function `<DiffOpt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> summarize\src\main.rs:31:7
   |
31 |     #[clap(long = "json")]
   |       ^^^^

warning: use of deprecated function `<SummarizeOpt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> summarize\src\main.rs:40:7
   |
40 |     #[clap(long = "json")]
   |       ^^^^

warning: use of deprecated function `<SummarizeOpt as clap::Args>::augment_args::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[arg(...)]`
  --> summarize\src\main.rs:44:7
   |
44 |     #[clap(short = 'p', long = "percent-above", default_value = "0.0")]
   |       ^^^^

warning: use of deprecated function `<Opt as clap::Subcommand>::augment_subcommands::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
  --> summarize\src\main.rs:51:7
   |
51 |     #[clap(name = "aggregate")]
   |       ^^^^

warning: use of deprecated function `<Opt as clap::Subcommand>::augment_subcommands::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
  --> summarize\src\main.rs:54:7
   |
54 |     #[clap(name = "diff")]
   |       ^^^^

warning: use of deprecated function `<Opt as clap::Subcommand>::augment_subcommands::old_attribute`: Attribute `#[clap(...)]` has been deprecated in favor of `#[command(...)]`
  --> summarize\src\main.rs:58:7
   |
58 |     #[clap(name = "summarize")]
   |       ^^^^
@michaelwoerister
Copy link
Member

UI layout changed

Can you elaborate? Do you mean the layout of the --help message?

@michaelwoerister michaelwoerister self-assigned this Mar 7, 2024
@klensy
Copy link
Contributor Author

klensy commented Mar 7, 2024

Yes, help changed and some colors, for example:

summarize 

USAGE:
    summarize.exe <SUBCOMMAND>

OPTIONS:
    -h, --help    Print help information

SUBCOMMANDS:
    aggregate    Processes a set of trace files with identical events and analyze variance
    diff         
    help         Print this message or the help of the given subcommand(s)
    summarize    Processes trace files and produces a summary

to:

Usage: summarize.exe <COMMAND>

Commands:
  aggregate  Processes a set of trace files with identical events and analyze variance
  diff       
  summarize  Processes trace files and produces a summary
  help       Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

TL\DR: measureme uses small portion of clap features, so porting 3-> 4 shouldn't have behavior changes.

@michaelwoerister
Copy link
Member

Thanks for the diff, @klensy! Yes, a change there shouldn't be a problem. We don't guarantee that to have any kind of defined shape.

@michaelwoerister michaelwoerister merged commit 7bbe7a9 into rust-lang:master Mar 7, 2024
4 checks passed
@michaelwoerister
Copy link
Member

Thanks for the PR, @klensy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants