diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-07 21:49:29 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-07 21:49:29 +0800 |
| commit | f5133df198050b82dbdf19a4b2b09c4c27ea07b0 (patch) | |
| tree | cc4e489ce4468f00d0c29321b96989e63d10b1b9 /src/entry.rs | |
| parent | 846dd60ef3f167b60f5472493f30a6705de692d5 (diff) | |
Rename subcommands and constants for clarity
Diffstat (limited to 'src/entry.rs')
| -rw-r--r-- | src/entry.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/entry.rs b/src/entry.rs index 4e91e59..f1d5203 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -10,7 +10,19 @@ pub async fn entry(ctx: ButckContext, args: Vec<String>) -> Result<(), ButckRWEr return match subcommand.as_str() { "write" => rw::storage::write(ctx).await, "build" => rw::storage::build(ctx).await, - "policies" => { + "lspolicy" => { + if ctx.stream_read.is_some() { + butck_policies::stream_policies() + .iter() + .for_each(|p| println!("{}", p)); + } else { + butck_policies::policies() + .iter() + .for_each(|p| println!("{}", p)); + } + return Ok(()); + } + "lspolicy-all" => { let policies = butck_policies::policies(); let stream_policies = butck_policies::stream_policies(); let mut all_policies: Vec<_> = @@ -20,18 +32,6 @@ pub async fn entry(ctx: ButckContext, args: Vec<String>) -> Result<(), ButckRWEr all_policies.iter().for_each(|p| println!("{}", p)); return Ok(()); } - "simple_policies" => { - butck_policies::policies() - .iter() - .for_each(|p| println!("{}", p)); - return Ok(()); - } - "stream_policies" => { - butck_policies::stream_policies() - .iter() - .for_each(|p| println!("{}", p)); - return Ok(()); - } _ => { print_help(); exit(1) |
