From ea3f3e6bb2ae237c16691c87bbf6e5364f9156e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Sat, 8 Jul 2023 07:03:01 +0200 Subject: [PATCH] feat(cli): added jump command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Still not implemented! Signed-off-by: Christina Sørensen --- doc/roadmap.org | 2 ++ src/cli.rs | 15 +++++++++++++++ src/main.rs | 3 +++ 3 files changed, 20 insertions(+) diff --git a/doc/roadmap.org b/doc/roadmap.org index 159ff0e..bae4000 100644 --- a/doc/roadmap.org +++ b/doc/roadmap.org @@ -1,5 +1,7 @@ #+title: Roadmap +* 0.2.1 +- [ ] jumps * 0.2.0 (maybe) - [X] Links in categories? - [X] Fix category with no links diff --git a/src/cli.rs b/src/cli.rs index 8c9ed78..6e6c150 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -109,4 +109,19 @@ pub enum Commands { /// Perform a git commit in all repositories, with predefined message #[command(visible_alias = "m")] CommitMsg { msg: Option }, + + /// Jump to a given object + #[command(subcommand, visible_alias = "j")] + Jump(JumpCommands), +} + +#[derive(Subcommand, Debug)] +pub enum JumpCommands { + /// Jump to repo + #[command(visible_alias = "r")] + Repo { name: Option }, + + /// Jump to link + #[command(visible_alias = "l")] + Link { name: Option }, } diff --git a/src/main.rs b/src/main.rs index e830ccd..abb2954 100644 --- a/src/main.rs +++ b/src/main.rs @@ -107,6 +107,9 @@ fn main() { Some(Commands::CommitMsg { msg }) => { config.commit_all_msg(msg.as_ref().expect("failed to get message from input")); } + Some(Commands::Jump(_)) => { + todo!(); + } None => (), } trace!("{:?}", config);