Allow dump with multi-value field option
Summary: After switching from structopt to clap, the default config for Vec changes from `.multiple_values(true)` to `.multiple_occurrence(true)`. This currently only affects the dump `--fields` option. Add back the old behavior.
@@ -962,7 +962,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)]
+ #[clap(short, long, multiple_values = true)]
fields: Option<Vec<SystemOptionField>>,
#[clap(flatten)]
opts: GeneralOpt,
@@ -973,7 +973,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)]
+ #[clap(short, long, multiple_values = true)]
fields: Option<Vec<DiskOptionField>>,
#[clap(flatten)]
opts: GeneralOpt,
@@ -987,7 +987,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)]
+ #[clap(short, long, multiple_values = true)]
fields: Option<Vec<ProcessOptionField>>,
#[clap(flatten)]
opts: GeneralOpt,
@@ -1001,7 +1001,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)]
+ #[clap(short, long, multiple_values = true)]
fields: Option<Vec<CgroupOptionField>>,
#[clap(flatten)]
opts: GeneralOpt,
@@ -1015,7 +1015,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)]
+ #[clap(short, long, multiple_values = true)]
fields: Option<Vec<IfaceOptionField>>,
#[clap(flatten)]
opts: GeneralOpt,
@@ -1029,7 +1029,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)]
+ #[clap(short, long, multiple_values = true)]
fields: Option<Vec<NetworkOptionField>>,
#[clap(flatten)]
opts: GeneralOpt,
@@ -1040,7 +1040,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)]
+ #[clap(short, long, multiple_values = true)]
fields: Option<Vec<TransportOptionField>>,
#[clap(flatten)]
opts: GeneralOpt,
