Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions dsc/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ pub enum ResourceSubCommand {
all: bool,
#[clap(short, long, help = t!("args.resource").to_string())]
resource: FullyQualifiedTypeName,
#[clap(short, long, help = t!("args.version").to_string())]
version: Option<ResourceVersionReq>,
#[clap(short = 'v', long, alias = "version", help = t!("args.version").to_string())]
required_version: Option<ResourceVersionReq>,
#[clap(short, long, help = t!("args.input").to_string(), conflicts_with = "file")]
input: Option<String>,
#[clap(short = 'f', long, help = t!("args.file").to_string(), conflicts_with = "input")]
Expand All @@ -234,8 +234,8 @@ pub enum ResourceSubCommand {
Set {
#[clap(short, long, help = t!("args.resource").to_string())]
resource: FullyQualifiedTypeName,
#[clap(short, long, help = t!("args.version").to_string())]
version: Option<ResourceVersionReq>,
#[clap(short = 'v', long, alias = "version", help = t!("args.version").to_string())]
required_version: Option<ResourceVersionReq>,
#[clap(short, long, help = t!("args.input").to_string(), conflicts_with = "file")]
input: Option<String>,
#[clap(short = 'f', long, help = t!("args.file").to_string(), conflicts_with = "input")]
Expand All @@ -249,8 +249,8 @@ pub enum ResourceSubCommand {
Test {
#[clap(short, long, help = t!("args.resource").to_string())]
resource: FullyQualifiedTypeName,
#[clap(short, long, help = t!("args.version").to_string())]
version: Option<ResourceVersionReq>,
#[clap(short = 'v', long, alias = "version", help = t!("args.version").to_string())]
required_version: Option<ResourceVersionReq>,
#[clap(short, long, help = t!("args.input").to_string(), conflicts_with = "file")]
input: Option<String>,
#[clap(short = 'f', long, help = t!("args.file").to_string(), conflicts_with = "input")]
Expand All @@ -262,8 +262,8 @@ pub enum ResourceSubCommand {
Delete {
#[clap(short, long, help = t!("args.resource").to_string())]
resource: FullyQualifiedTypeName,
#[clap(short, long, help = t!("args.version").to_string())]
version: Option<ResourceVersionReq>,
#[clap(short = 'v', long, alias = "version", help = t!("args.version").to_string())]
required_version: Option<ResourceVersionReq>,
#[clap(short, long, help = t!("args.input").to_string(), conflicts_with = "file")]
input: Option<String>,
#[clap(short = 'f', long, help = t!("args.file").to_string(), conflicts_with = "input")]
Expand All @@ -277,17 +277,17 @@ pub enum ResourceSubCommand {
Schema {
#[clap(short, long, help = t!("args.resource").to_string())]
resource: FullyQualifiedTypeName,
#[clap(short, long, help = t!("args.version").to_string())]
version: Option<ResourceVersionReq>,
#[clap(short = 'v', long, alias = "version", help = t!("args.version").to_string())]
required_version: Option<ResourceVersionReq>,
#[clap(short = 'o', long, help = t!("args.outputFormat").to_string())]
output_format: Option<OutputFormat>,
},
#[clap(name = "export", about = "Retrieve all resource instances", arg_required_else_help = true)]
Export {
#[clap(short, long, help = t!("args.resource").to_string())]
resource: FullyQualifiedTypeName,
#[clap(short, long, help = t!("args.version").to_string())]
version: Option<ResourceVersionReq>,
#[clap(short = 'v', long, alias = "version", help = t!("args.version").to_string())]
required_version: Option<ResourceVersionReq>,
#[clap(short, long, help = t!("args.input").to_string(), conflicts_with = "file")]
input: Option<String>,
#[clap(short = 'f', long, help = t!("args.file").to_string(), conflicts_with = "input")]
Expand Down
12 changes: 6 additions & 6 deletions dsc/src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,22 +555,22 @@ pub fn resource(subcommand: &ResourceSubCommand, progress_format: ProgressFormat
ResourceSubCommand::List { resource_name, adapter_name, description, tags, output_format } => {
list_resources(&mut dsc, resource_name, adapter_name.as_ref(), description.as_ref(), tags.as_ref(), output_format.as_ref(), progress_format);
},
ResourceSubCommand::Schema { resource , version, output_format } => {
ResourceSubCommand::Schema { resource, required_version: version, output_format } => {
if let Err(err) = dsc.find_resources(&[DiscoveryFilter::new(resource, version.clone(), None)], progress_format) {
error!("{}: {err}", t!("subcommand.failedDiscoverResource"));
exit(EXIT_DSC_ERROR);
}
resource_command::schema(&mut dsc, resource, version.as_ref(), output_format.as_ref());
},
ResourceSubCommand::Export { resource, version, input, file, output_format } => {
ResourceSubCommand::Export { resource, required_version: version, input, file, output_format } => {
if let Err(err) = dsc.find_resources(&[DiscoveryFilter::new(resource, version.clone(), None)], progress_format) {
error!("{}: {err}", t!("subcommand.failedDiscoverResource"));
exit(EXIT_DSC_ERROR);
}
let parsed_input = get_input(input.as_ref(), file.as_ref());
resource_command::export(&mut dsc, resource, version.as_ref(), &parsed_input, output_format.as_ref());
},
ResourceSubCommand::Get { resource, version, input, file: path, all, output_format } => {
ResourceSubCommand::Get { resource, required_version: version, input, file: path, all, output_format } => {
if let Err(err) = dsc.find_resources(&[DiscoveryFilter::new(resource, version.clone(), None)], progress_format) {
error!("{}: {err}", t!("subcommand.failedDiscoverResource"));
exit(EXIT_DSC_ERROR);
Expand All @@ -587,23 +587,23 @@ pub fn resource(subcommand: &ResourceSubCommand, progress_format: ProgressFormat
resource_command::get(&mut dsc, resource, version.as_ref(), &parsed_input, output_format.as_ref());
}
},
ResourceSubCommand::Set { resource, version, input, file: path, output_format, what_if } => {
ResourceSubCommand::Set { resource, required_version: version, input, file: path, output_format, what_if } => {
if let Err(err) = dsc.find_resources(&[DiscoveryFilter::new(resource, version.clone(), None)], progress_format) {
error!("{}: {err}", t!("subcommand.failedDiscoverResource"));
exit(EXIT_DSC_ERROR);
}
let parsed_input = get_input(input.as_ref(), path.as_ref());
resource_command::set(&mut dsc, resource, version.as_ref(), &parsed_input, output_format.as_ref(), *what_if);
},
ResourceSubCommand::Test { resource, version, input, file: path, output_format } => {
ResourceSubCommand::Test { resource, required_version: version, input, file: path, output_format } => {
if let Err(err) = dsc.find_resources(&[DiscoveryFilter::new(resource, version.clone(), None)], progress_format) {
error!("{}: {err}", t!("subcommand.failedDiscoverResource"));
exit(EXIT_DSC_ERROR);
}
let parsed_input = get_input(input.as_ref(), path.as_ref());
resource_command::test(&mut dsc, resource, version.as_ref(), &parsed_input, output_format.as_ref());
},
ResourceSubCommand::Delete { resource, version, input, file: path, output_format, what_if } => {
ResourceSubCommand::Delete { resource, required_version: version, input, file: path, output_format, what_if } => {
if let Err(err) = dsc.find_resources(&[DiscoveryFilter::new(resource, version.clone(), None)], progress_format) {
error!("{}: {err}", t!("subcommand.failedDiscoverResource"));
exit(EXIT_DSC_ERROR);
Expand Down
Loading