Skip to content

Commit

Permalink
Merge pull request #154 from peridio/ENG-1642
Browse files Browse the repository at this point in the history
fix bug in CLI tag parsing
  • Loading branch information
andresperi committed Apr 23, 2024
2 parents 1d620b7 + 999c0d7 commit 6a12b4c
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -3,7 +3,7 @@ name = "peridio-cli"
description = "Peridio CLI"
homepage = "https://peridio.com"
repository = "https://github.com/peridio/peridio-cli"
version = "0.19.1"
version = "0.19.2"
edition = "2021"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions src/api/ca_certificates.rs
Expand Up @@ -56,7 +56,7 @@ pub struct CreateCommand {
jitp_description: Option<String>,

/// Tags that will be automatically applied to devices that JITP with this CA certificate.
#[arg(long, requires_all = &["jitp_description", "jitp_product_name"])]
#[arg(long, requires_all = &["jitp_description", "jitp_product_name"], num_args = 0.., value_delimiter = ',')]
jitp_tags: Vec<String>,

/// The product that will be automatically applied to devices that JITP with this CA certificate.
Expand Down Expand Up @@ -230,7 +230,7 @@ pub struct UpdateCommand {
jitp_description: Option<String>,

/// Tags that will be automatically applied to devices that JITP with this CA certificate.
#[arg(long, requires_all = &["jitp_description", "jitp_product_name"])]
#[arg(long, requires_all = &["jitp_description", "jitp_product_name"], num_args = 0.., value_delimiter = ',')]
jitp_tags: Vec<String>,

/// The product that will be automatically applied to devices that JITP with this CA certificate.
Expand Down
4 changes: 2 additions & 2 deletions src/api/deployments.rs
Expand Up @@ -57,7 +57,7 @@ pub struct CreateCommand {
name: String,

/// A list of tags that must be present on a device for it to be eligible for this deployment.
#[arg(long, required = true)]
#[arg(long, required = true, num_args = 0.., value_delimiter = ',')]
tags: Vec<String>,

/// A SemVer requirement that must be satisfied by a device's version for the device to be eligible for this deployment.
Expand Down Expand Up @@ -218,7 +218,7 @@ pub struct UpdateCommand {
name: Option<String>,

/// A list of tags that must be present on a device for it to be eligible for this deployment.
#[arg(long)]
#[arg(long, num_args = 0.., value_delimiter = ',')]
tags: Option<Vec<String>>,

/// A SemVer requirement that must be satisfied by a device's version for the device to be eligible for this deployment.
Expand Down
4 changes: 2 additions & 2 deletions src/api/devices.rs
Expand Up @@ -63,7 +63,7 @@ pub struct CreateCommand {
/// A list of tags to attach to the device.
///
/// If using firmwares and deployments, tags can be used to target devices.
#[arg(long)]
#[arg(long, num_args = 0.., value_delimiter = ',')]
tags: Option<Vec<String>>,

/// The target of the device.
Expand Down Expand Up @@ -225,7 +225,7 @@ pub struct UpdateCommand {
product_name: String,

/// A list of tags to attach to the device.
#[arg(long)]
#[arg(long, num_args = 0.., value_delimiter = ',')]
tags: Option<Vec<String>>,

/// The target of the device.
Expand Down
4 changes: 3 additions & 1 deletion src/api/releases.rs
Expand Up @@ -64,6 +64,8 @@ pub struct CreateCommand {
long,
conflicts_with = "phase_value",
required_unless_present_any = ["phase_value"],
num_args = 0..,
value_delimiter = ',',
)]
phase_tags: Option<Vec<String>>,

Expand Down Expand Up @@ -246,7 +248,7 @@ pub struct UpdateCommand {

/// Limits by tags the devices that are allowed to update to this release.
/// When phase_mode is tags, this field only allows devices to update to this release if they have at least one of these tags.
#[arg(long)]
#[arg(long, num_args = 0.., value_delimiter = ',')]
pub phase_tags: Option<Vec<String>>,

/// The phase value controls the distribution of the update to your fleet.
Expand Down
4 changes: 2 additions & 2 deletions src/api/webhooks.rs
Expand Up @@ -50,7 +50,7 @@ pub struct CreateCommand {
/// The events that will trigger the webhook.
///
/// Supply the flag multiple times to add multiple events.
#[arg(long)]
#[arg(long, num_args = 0.., value_delimiter = ',')]
enabled_events: Option<Vec<String>>,
/// The URL that the webhook will send a POST request to.
#[arg(long)]
Expand Down Expand Up @@ -215,7 +215,7 @@ pub struct UpdateCommand {
/// The events that will trigger the webhook.
///
/// Supply the flag multiple times to add multiple events.
#[arg(long)]
#[arg(long, num_args = 0.., value_delimiter = ',')]
pub enabled_events: Option<Vec<String>>,
}

Expand Down

0 comments on commit 6a12b4c

Please sign in to comment.