diff options
Diffstat (limited to '')
-rw-r--r-- | pkgs/by-name/ts/tskm/src/cli.rs | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/pkgs/by-name/ts/tskm/src/cli.rs b/pkgs/by-name/ts/tskm/src/cli.rs index 0e32fa62..90d6023b 100644 --- a/pkgs/by-name/ts/tskm/src/cli.rs +++ b/pkgs/by-name/ts/tskm/src/cli.rs @@ -8,7 +8,7 @@ // You should have received a copy of the License along with this program. // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -use std::{ffi::OsStr, fmt::Display, path::PathBuf}; +use std::{ffi::OsStr, path::PathBuf}; use anyhow::{bail, Result}; use clap::{builder::StyledStr, ArgAction, Parser, Subcommand, ValueEnum}; @@ -28,7 +28,7 @@ use crate::{ /// This is the core interface to the system-integrated task management /// /// `tskm` effectively combines multiple applications together: -/// - `taskwarrior` projects are raised connected to `firefox` profiles, making it possible to “open” +/// - `taskwarrior` projects are connected to `qutebrowser` profiles, making it possible to “open” /// a project. /// /// - Every `taskwarrior` project has a determined `neorg` path, so that extra information for a @@ -69,7 +69,7 @@ pub enum Command { command: NeorgCommand, }, - /// Interface with the Firefox profile of each project. + /// Interface with the Qutebrowser profile of each project. Open { #[command(subcommand)] command: OpenCommand, @@ -94,8 +94,8 @@ pub enum NeorgCommand { /// Open the `neorg` project associated with id of the task. Task { /// The working set id of the task - #[arg(value_parser = task_from_working_set_id, add = ArgValueCompleter::new(complete_task_id))] - id: task::Task, + #[arg(value_name = "ID", value_parser = task_from_working_set_id, add = ArgValueCompleter::new(complete_task_id))] + task: task::Task, }, } @@ -111,12 +111,16 @@ fn task_from_working_set_id(id: &str) -> Result<task::Task> { #[derive(Subcommand, Debug)] pub enum OpenCommand { - /// Open each project's Firefox profile consecutively, that was opened since the last review. + /// Open each project's Qutebrowser profile consecutively, that was opened since the last review. /// /// This allows you to remove stale opened tabs and to commit open tabs to the `inputs`. - Review, + Review { + /// Review all projects, if they contain tabs + #[arg(short, long, default_value_t)] + non_empty: bool, + }, - /// Opens Firefox with either the supplied project or the currently active project profile. + /// Opens Qutebrowser with either the supplied project or the currently active project profile. Project { /// The project to open. #[arg(value_parser = task::Project::from_project_string, add = ArgValueCompleter::new(complete_project))] @@ -126,7 +130,7 @@ pub enum OpenCommand { url: Option<Url>, }, - /// Open a selected project in it's Firefox profile. + /// Open a selected project in it's Qutebrowser profile. /// /// This will use rofi's dmenu mode to select one project from the list of all registered /// projects. @@ -137,12 +141,25 @@ pub enum OpenCommand { /// List all open tabs in the project. ListTabs { - /// The project to open. + /// The projects to open. #[arg(value_parser = task::Project::from_project_string, add = ArgValueCompleter::new(complete_project))] - project: Option<task::Project>, + projects: Option<Vec<task::Project>>, + + /// Only show the tabs, that are in this mode + #[arg(short, long, conflicts_with = "projects")] + mode: Option<ListMode>, }, } +#[derive(Clone, Copy, ValueEnum, Debug)] +pub enum ListMode { + // The tab contains no tabs. + Empty, + + // The tab contains tabs. + NonEmpty, +} + #[derive(Subcommand, Debug)] pub enum InputCommand { /// Add URLs as inputs to be categorized. @@ -179,6 +196,9 @@ pub enum InputCommand { #[arg(add = ArgValueCompleter::new(complete_tag))] tags: Vec<Tag>, }, + + /// Show all the available tags. + Tags {}, } fn complete_task_id(current: &OsStr) -> Vec<CompletionCandidate> { |