Ugh
This commit is contained in:
19
src/args.rs
19
src/args.rs
@@ -41,7 +41,6 @@ pub struct ModeArgs {
|
||||
#[arg(help("List items, filtering on tags or metadata if given"))]
|
||||
pub list: bool,
|
||||
|
||||
|
||||
#[arg(group("mode"), help_heading("Mode Options"), short, long, conflicts_with_all(["save", "get", "diff", "list", "info", "status"]))]
|
||||
#[arg(help("Delete items either by ID or by matching tags"))]
|
||||
#[arg(requires = "ids_or_tags")]
|
||||
@@ -85,7 +84,12 @@ pub struct ItemArgs {
|
||||
#[arg(help("Compression algorithm to use when saving items"))]
|
||||
pub compression: Option<String>,
|
||||
|
||||
#[arg(help_heading("Item Options"), short('M'), long, env("KEEP_META_PLUGINS"))]
|
||||
#[arg(
|
||||
help_heading("Item Options"),
|
||||
short('M'),
|
||||
long,
|
||||
env("KEEP_META_PLUGINS")
|
||||
)]
|
||||
#[arg(help("Meta plugins to use when saving items"))]
|
||||
pub meta_plugins: Vec<String>,
|
||||
|
||||
@@ -94,7 +98,6 @@ pub struct ItemArgs {
|
||||
pub filters: Option<String>,
|
||||
}
|
||||
|
||||
|
||||
/// Struct for general options, including verbosity, paths, and output settings.
|
||||
#[derive(Parser, Debug, Default, Clone)]
|
||||
pub struct OptionsArgs {
|
||||
@@ -138,7 +141,10 @@ pub struct OptionsArgs {
|
||||
#[arg(help("Password hash for server authentication (requires --server)"))]
|
||||
pub server_password_hash: Option<String>,
|
||||
|
||||
#[arg(long, help("Force output even when binary data would be sent to a TTY"))]
|
||||
#[arg(
|
||||
long,
|
||||
help("Force output even when binary data would be sent to a TTY")
|
||||
)]
|
||||
pub force: bool,
|
||||
}
|
||||
|
||||
@@ -170,7 +176,7 @@ impl Args {
|
||||
if self.mode.delete && self.ids_or_tags.is_empty() {
|
||||
return Err("At least one ID is required when using --delete".to_string());
|
||||
}
|
||||
|
||||
|
||||
// Check if --delete is used and any of the ids_or_tags are tags (strings)
|
||||
if self.mode.delete {
|
||||
for item in &self.ids_or_tags {
|
||||
@@ -179,8 +185,7 @@ impl Args {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user