list profiles

This commit is contained in:
aaron-jack-manning
2022-09-03 12:28:25 +10:00
parent 310aa84f50
commit ae7887fd35
5 changed files with 115 additions and 14 deletions

View File

@@ -69,6 +69,9 @@ pub enum Command {
GitIgnore,
/// Lists tasks according to the specified fields, ordering and filters.
List {
/// Use an existing profile for list options, ignoring other arguments.
#[clap(long)]
profile : Option<String>,
#[clap(flatten)]
options : ListOptions,
},
@@ -104,7 +107,7 @@ pub enum Command {
},
}
#[derive(clap::StructOpt, Debug, PartialEq, Eq)]
#[derive(clap::StructOpt, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub struct ListOptions {
/// Which columns to include.
#[clap(short, value_enum)]
@@ -195,7 +198,26 @@ pub enum ConfigCommand {
Editor {
/// Command to launch editor. Omit to view current editor.
editor : Option<String>,
}
},
/// For working with profiles for the list command.
#[clap(subcommand)]
Profile(ProfileCommand),
}
#[derive(clap::Subcommand, Debug, PartialEq, Eq)]
pub enum ProfileCommand {
New {
/// Name of the new profile.
name : String,
#[clap(flatten)]
options : ListOptions,
},
Delete {
/// Name of the profile to delete.
name : String,
},
/// List names of currently set up profiles.
List,
}
#[derive(clap::Subcommand, Debug, PartialEq, Eq)]