Skip to content

Commit 35c35f2

Browse files
authored
fix(cli): features should support a comma separated list (#14931)
1 parent 7d01aa0 commit 35c35f2

14 files changed

Lines changed: 233 additions & 48 deletions

File tree

.changes/features-separator.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"tauri-cli": patch:bug
3+
"@tauri-apps/cli": patch:bug
4+
---
5+
6+
Support comma-separated list of Cargo features on all commands.

crates/tauri-cli/src/acl/permission/new.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ pub struct Options {
2424
#[clap(long)]
2525
description: Option<String>,
2626
/// List of commands to allow
27-
#[clap(short, long, use_value_delimiter = true)]
27+
#[clap(short, long, value_delimiter = ',')]
2828
allow: Option<Vec<String>>,
2929
/// List of commands to deny
30-
#[clap(short, long, use_value_delimiter = true)]
30+
#[clap(short, long, value_delimiter = ',')]
3131
deny: Option<Vec<String>>,
3232
/// Output file format.
3333
#[clap(long, default_value_t = FileFormat::Json)]

crates/tauri-cli/src/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub struct Options {
3939
#[clap(short, long)]
4040
pub target: Option<String>,
4141
/// Space or comma separated list of features to activate
42-
#[clap(short, long, action = ArgAction::Append, num_args(0..))]
42+
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
4343
pub features: Vec<String>,
4444
/// Space or comma separated list of bundles to package.
4545
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
@@ -117,7 +117,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
117117

118118
let bin_path = interface.build(interface_options, &dirs)?;
119119

120-
log::info!(action ="Built"; "application at: {}", tauri_utils::display_path(bin_path));
120+
log::info!(action = "Built"; "application at: {}", tauri_utils::display_path(bin_path));
121121

122122
let app_settings = interface.app_settings();
123123

crates/tauri-cli/src/bundle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub struct Options {
7070
#[clap(short, long)]
7171
pub config: Vec<ConfigValue>,
7272
/// Space or comma separated list of features, should be the same features passed to `tauri build` if any.
73-
#[clap(short, long, action = ArgAction::Append, num_args(0..))]
73+
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
7474
pub features: Vec<String>,
7575
/// Target triple to build against.
7676
///

crates/tauri-cli/src/dev.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub struct Options {
5454
#[clap(short, long)]
5555
pub target: Option<String>,
5656
/// List of cargo features to activate
57-
#[clap(short, long, action = ArgAction::Append, num_args(0..))]
57+
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
5858
pub features: Vec<String>,
5959
/// Exit on panic
6060
#[clap(short, long)]

crates/tauri-cli/src/icon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub struct Options {
9494
output: Option<PathBuf>,
9595

9696
/// Custom PNG icon sizes to generate. When set, the default icons are not generated.
97-
#[clap(short, long, use_value_delimiter = true)]
97+
#[clap(short, long, value_delimiter = ',')]
9898
png: Option<Vec<u32>>,
9999

100100
/// The background color of the iOS icon - string as defined in the W3C's CSS Color Module Level 4 <https://www.w3.org/TR/css-color-4/>.

crates/tauri-cli/src/mobile/android/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct Options {
4848
)]
4949
pub targets: Option<Vec<String>>,
5050
/// List of cargo features to activate
51-
#[clap(short, long, action = ArgAction::Append, num_args(0..))]
51+
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
5252
pub features: Vec<String>,
5353
/// JSON strings or paths to JSON, JSON5 or TOML files to merge with the default configuration file
5454
///

crates/tauri-cli/src/mobile/android/dev.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use std::{env::set_current_dir, net::Ipv4Addr, path::PathBuf};
4444
)]
4545
pub struct Options {
4646
/// List of cargo features to activate
47-
#[clap(short, long, action = ArgAction::Append, num_args(0..))]
47+
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
4848
pub features: Vec<String>,
4949
/// Exit on panic
5050
#[clap(short, long)]

crates/tauri-cli/src/mobile/android/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct Options {
2929
#[clap(short, long)]
3030
pub release: bool,
3131
/// List of cargo features to activate
32-
#[clap(short, long, action = ArgAction::Append, num_args(0..))]
32+
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
3333
pub features: Vec<String>,
3434
/// JSON strings or paths to JSON, JSON5 or TOML files to merge with the default configuration file
3535
///

crates/tauri-cli/src/mobile/ios/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub struct Options {
5959
)]
6060
pub targets: Option<Vec<String>>,
6161
/// List of cargo features to activate
62-
#[clap(short, long, action = ArgAction::Append, num_args(0..))]
62+
#[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')]
6363
pub features: Vec<String>,
6464
/// JSON strings or paths to JSON, JSON5 or TOML files to merge with the default configuration file
6565
///

0 commit comments

Comments
 (0)