You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
3.5 KiB
90 lines
3.5 KiB
From a1b257d91677637063c1eb359097d53078f7272a Mon Sep 17 00:00:00 2001
|
|
From: Michel Salim <michel@meta.com>
|
|
Date: Wed, 2 Aug 2023 12:19:57 -0700
|
|
Subject: [PATCH] migrate to Clap 4
|
|
|
|
Summary:
|
|
Two `below` crates currently still use Clap 3; update to 4.
|
|
|
|
This unblocks updating below in Fedora which has dropped clap 3 from its repos.
|
|
|
|
Reviewed By: brianc118
|
|
|
|
Differential Revision: D48002223
|
|
|
|
fbshipit-source-id: 5f4d02fced4f182098b3ee7627b0af3179d9addb
|
|
---
|
|
below/Cargo.toml | 4 ++--
|
|
below/dump/Cargo.toml | 2 +-
|
|
below/dump/src/command.rs | 14 +++++++-------
|
|
below/src/main.rs | 8 ++++----
|
|
4 files changed, 14 insertions(+), 14 deletions(-)
|
|
|
|
diff --git a/below/dump/src/command.rs b/below/dump/src/command.rs
|
|
index 50aa60a0..aca370ec 100644
|
|
--- a/src/command.rs
|
|
+++ b/src/command.rs
|
|
@@ -1045,7 +1045,7 @@ pub enum DumpCommand {
|
|
#[clap(about = SYSTEM_ABOUT, long_about = SYSTEM_LONG_ABOUT.as_str())]
|
|
System {
|
|
/// Select which fields to display and in what order.
|
|
- #[clap(short, long, multiple_values = true)]
|
|
+ #[clap(short, long, num_args = 1..)]
|
|
fields: Option<Vec<SystemOptionField>>,
|
|
#[clap(flatten)]
|
|
opts: GeneralOpt,
|
|
@@ -1056,7 +1056,7 @@ pub enum DumpCommand {
|
|
#[clap(about = DISK_ABOUT, long_about = DISK_LONG_ABOUT.as_str())]
|
|
Disk {
|
|
/// Select which fields to display and in what order.
|
|
- #[clap(short, long, multiple_values = true)]
|
|
+ #[clap(short, long, num_args = 1..)]
|
|
fields: Option<Vec<DiskOptionField>>,
|
|
#[clap(flatten)]
|
|
opts: GeneralOpt,
|
|
@@ -1084,7 +1084,7 @@ pub enum DumpCommand {
|
|
#[clap(about = PROCESS_ABOUT, long_about = PROCESS_LONG_ABOUT.as_str())]
|
|
Process {
|
|
/// Select which fields to display and in what order.
|
|
- #[clap(short, long, multiple_values = true)]
|
|
+ #[clap(short, long, num_args = 1..)]
|
|
fields: Option<Vec<ProcessOptionField>>,
|
|
#[clap(flatten)]
|
|
opts: GeneralOpt,
|
|
@@ -1098,7 +1098,7 @@ pub enum DumpCommand {
|
|
#[clap(about = CGROUP_ABOUT, long_about = CGROUP_LONG_ABOUT.as_str())]
|
|
Cgroup {
|
|
/// Select which fields to display and in what order.
|
|
- #[clap(short, long, multiple_values = true)]
|
|
+ #[clap(short, long, num_args = 1..)]
|
|
fields: Option<Vec<CgroupOptionField>>,
|
|
#[clap(flatten)]
|
|
opts: GeneralOpt,
|
|
@@ -1112,7 +1112,7 @@ pub enum DumpCommand {
|
|
#[clap(about = IFACE_ABOUT, long_about = IFACE_LONG_ABOUT.as_str())]
|
|
Iface {
|
|
/// Select which fields to display and in what order.
|
|
- #[clap(short, long, multiple_values = true)]
|
|
+ #[clap(short, long, num_args = 1..)]
|
|
fields: Option<Vec<IfaceOptionField>>,
|
|
#[clap(flatten)]
|
|
opts: GeneralOpt,
|
|
@@ -1126,7 +1126,7 @@ pub enum DumpCommand {
|
|
#[clap(about = NETWORK_ABOUT, long_about = NETWORK_LONG_ABOUT.as_str())]
|
|
Network {
|
|
/// Select which fields to display and in what order.
|
|
- #[clap(short, long, multiple_values = true)]
|
|
+ #[clap(short, long, num_args = 1..)]
|
|
fields: Option<Vec<NetworkOptionField>>,
|
|
#[clap(flatten)]
|
|
opts: GeneralOpt,
|
|
@@ -1137,7 +1137,7 @@ pub enum DumpCommand {
|
|
#[clap(about = TRANSPORT_ABOUT, long_about = TRANSPORT_LONG_ABOUT.as_str())]
|
|
Transport {
|
|
/// Select which fields to display and in what order.
|
|
- #[clap(short, long, multiple_values = true)]
|
|
+ #[clap(short, long, num_args = 1..)]
|
|
fields: Option<Vec<TransportOptionField>>,
|
|
#[clap(flatten)]
|
|
opts: GeneralOpt,
|