diff --git a/src/cli.rs b/src/cli.rs index 3b84916..abc11cf 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,5 +1,6 @@ use crate::cli::prelude::*; +mod config; mod gitlab; mod jira; mod prelude; @@ -13,16 +14,16 @@ pub struct Cli { #[command(subcommand)] pub command: Commands, - /// The directory to write log files (defaults to $XDG_CACHE_HOME/taskr/logs) - #[arg(long, default_value = None)] - pub logs_directory: Option, - /// Define which tracing values are logged /// See https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html /// for details #[arg(long, default_value = None)] pub tracing_env_filter: Option, + /// The directory to write log files (defaults to $XDG_CACHE_HOME/taskr/logs) + #[arg(long, default_value = None)] + pub logs_directory: Option, + /// The directory that data is stored in (defaults to $XDG_DATA_HOME/taskr/data) #[arg(long, default_value = None)] pub data_directory: Option, @@ -58,6 +59,10 @@ pub enum Commands { /// Interact with the configured GitLab endpoint #[command(subcommand)] Gitlab(gitlab::Command), + + /// Interact with the configured GitLab endpoint + #[command(subcommand)] + Config(config::Command), } #[derive(Args)] diff --git a/src/cli/config.rs b/src/cli/config.rs new file mode 100644 index 0000000..bb8f078 --- /dev/null +++ b/src/cli/config.rs @@ -0,0 +1,26 @@ +use crate::cli::prelude::*; + +#[derive(Subcommand)] +pub enum Command { + Show, +} + +impl Command { + pub async fn exec(&self, tasks: SharedTasks) -> Result<()> { + match self { + Command::Show => self.show().await, + } + } + + pub async fn show(&self) -> Result<()> {} +} + +#[derive(Parser)] +pub struct MeArgs {} + +impl MeArgs { + pub async fn me(&self, tasks: SharedTasks) -> Result<()> { + println!("{:#?}", tasks.gitlab()?.me().await?); + Ok(()) + } +}