Remove unused xml arg
This arg was obsolete since --file can be used for all file types
@@ -718,14 +718,34 @@ fn run() -> Result<(), CliError> {
{
use clap::{Arg, SubCommand};
- #[allow(unused_mut)]
- let mut create_product_subcmd = SubCommand::with_name("create")
+ app = app.subcommand(
+ SubCommand::with_name("product")
+ .about("Create, update, delete, list, or show products")
+ .setting(clap::AppSettings::SubcommandRequiredElseHelp)
+ .arg(
+ Arg::with_name("service_id")
+ .long("service-id")
+ .takes_value(true)
+ .help(
+ "The ID of the service the payload should be \
+ sent to; required if running on Splinter. Format \
+ <circuit-id>::<service-id>",
+ ),
+ )
+ .arg(
+ Arg::with_name("url")
+ .long("url")
+ .takes_value(true)
+ .help("URL for the REST API"),
+ )
+ .subcommand(
+ SubCommand::with_name("create")
.about("Create a product")
.arg(
Arg::with_name("product_id")
.conflicts_with("file")
.takes_value(true)
- .required_unless_one(&["file", "xml"])
+ .required_unless("file")
.help("Unique ID for product"),
)
.arg(
@@ -733,7 +753,6 @@ fn run() -> Result<(), CliError> {
.long("namespace")
.takes_value(true)
.conflicts_with("file")
- .conflicts_with("xml")
.help("Product namespace (example: GS1)"),
)
.arg(
@@ -757,7 +776,6 @@ fn run() -> Result<(), CliError> {
.long("file")
.short("f")
.takes_value(true)
- .conflicts_with("xml")
.help("Path to yaml file containing a list of products"),
#[cfg(feature = "product-gdsn")]
Arg::with_name("file")
@@ -766,7 +784,7 @@ fn run() -> Result<(), CliError> {
.takes_value(true)
.multiple(true)
.number_of_values(1)
- .help("Path to yaml file containing a list of products"),
+ .help("Path to file containing a list of products"),
)
.arg(
Arg::with_name("key")
@@ -780,41 +798,8 @@ fn run() -> Result<(), CliError> {
.long("wait")
.takes_value(true)
.help("How long to wait for transaction to be committed"),
- );
-
- #[cfg(feature = "product-gdsn")]
- {
- create_product_subcmd = create_product_subcmd.arg(
- Arg::with_name("xml")
- .long("xml")
- .short("x")
- .takes_value(true)
- .conflicts_with("file")
- .help("Path to xml file containing a product definition"),
- )
- }
-
- app = app.subcommand(
- SubCommand::with_name("product")
- .about("Create, update, delete, list, or show products")
- .setting(clap::AppSettings::SubcommandRequiredElseHelp)
- .arg(
- Arg::with_name("service_id")
- .long("service-id")
- .takes_value(true)
- .help(
- "The ID of the service the payload should be \
- sent to; required if running on Splinter. Format \
- <circuit-id>::<service-id>",
- ),
)
- .arg(
- Arg::with_name("url")
- .long("url")
- .takes_value(true)
- .help("URL for the REST API"),
)
- .subcommand(create_product_subcmd)
.subcommand(
SubCommand::with_name("update")
.about("Update products from a yaml file")
