Skip to content

Commit 391961f

Browse files
committed
feat(pluginlab): add short flags for allow-net, allow-read, allow-write
- `-N` for `allow-net` - `-R` for `allow-read` - `-W` for `allow-write` You can use them like this: ```sh pluginlab -R pluginlab -RW pluginlab -RWN # same as pluginlab -A ```
1 parent 90d6581 commit 391961f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/pluginlab/src/cli.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ pub struct Cli {
2020
pub dir: PathBuf,
2121

2222
/// Allow network access
23-
#[arg(long, num_args = 0..=1, default_missing_value = "@")]
23+
#[arg(short = 'N', long, num_args = 0..=1, default_missing_value = "@")]
2424
// How it works:
2525
// no flag -> None
2626
// --allow-net -> Some("@") - because "@" is not a valid value for a domain nor an IP address
2727
// --allow-net google.com,example.com -> Some("google.com,example.com")
2828
pub allow_net: Option<String>,
2929

3030
/// Allow file system read access
31-
#[arg(long, default_value_t = false)]
31+
#[arg(short = 'R', long, default_value_t = false)]
3232
pub allow_read: bool,
3333

3434
/// Allow file system write access
35-
#[arg(long, default_value_t = false)]
35+
#[arg(short = 'W', long, default_value_t = false)]
3636
pub allow_write: bool,
3737

3838
/// Allow all permissions

0 commit comments

Comments
 (0)