diff --git a/docs/cli/activate.md b/docs/cli/activate.md new file mode 100644 index 0000000..44ee970 --- /dev/null +++ b/docs/cli/activate.md @@ -0,0 +1,13 @@ +# `pitchfork activate` + +- **Usage**: `pitchfork activate ` + +Activate pitchfork in your shell session + +Necessary for autostart/stop when entering/exiting projects with pitchfork.toml files + +## Arguments + +### `` + +The shell to generate source for diff --git a/docs/cli/commands.json b/docs/cli/commands.json index eed7de0..b2d9635 100644 --- a/docs/cli/commands.json +++ b/docs/cli/commands.json @@ -5,6 +5,32 @@ "full_cmd": [], "usage": "", "subcommands": { + "activate": { + "full_cmd": [ + "activate" + ], + "usage": "activate ", + "subcommands": {}, + "args": [ + { + "name": "SHELL", + "usage": "", + "help": "The shell to generate source for", + "help_first_line": "The shell to generate source for", + "required": true, + "hide": false + } + ], + "flags": [], + "mounts": [], + "hide": false, + "help": "Activate pitchfork in your shell session", + "help_long": "Activate pitchfork in your shell session\n\nNecessary for autostart/stop when entering/exiting projects with pitchfork.toml files", + "name": "activate", + "aliases": [], + "hidden_aliases": [], + "examples": [] + }, "add": { "full_cmd": [ "add" diff --git a/docs/cli/index.md b/docs/cli/index.md index 1f01313..a6a5271 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -6,6 +6,7 @@ ## Subcommands +- [`pitchfork activate `](/cli/activate.md) - [`pitchfork add`](/cli/add.md) - [`pitchfork clean`](/cli/clean.md) - [`pitchfork completion `](/cli/completion.md) diff --git a/pitchfork.usage.kdl b/pitchfork.usage.kdl index 30aa39f..3509826 100644 --- a/pitchfork.usage.kdl +++ b/pitchfork.usage.kdl @@ -1,6 +1,12 @@ name "pitchfork-cli" bin "pitchfork" usage "Usage: pitchfork-cli " +cmd "activate" help="Activate pitchfork in your shell session" { + long_help r"Activate pitchfork in your shell session + +Necessary for autostart/stop when entering/exiting projects with pitchfork.toml files" + arg "" help="The shell to generate source for" +} cmd "add" help="Add a new daemon to pitchfork.toml" { alias "a" } diff --git a/src/cli/activate.rs b/src/cli/activate.rs new file mode 100644 index 0000000..b4b30f8 --- /dev/null +++ b/src/cli/activate.rs @@ -0,0 +1,18 @@ +use crate::Result; + +/// Activate pitchfork in your shell session +/// +/// Necessary for autostart/stop when entering/exiting projects with pitchfork.toml files +#[derive(Debug, clap::Args)] +#[clap(verbatim_doc_comment)] +pub struct Activate { + /// The shell to generate source for + #[clap()] + shell: String, +} + +impl Activate { + pub async fn run(&self) -> Result<()> { + unimplemented!(); + } +} diff --git a/src/cli/mod.rs b/src/cli/mod.rs index f92ec16..600c4d0 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -1,6 +1,7 @@ use crate::Result; use clap::Parser; +mod activate; mod add; mod clean; mod completion; @@ -25,6 +26,7 @@ struct Cli { #[derive(Debug, clap::Subcommand)] enum Commands { + Activate(activate::Activate), Add(add::Add), Clean(clean::Clean), Completion(completion::Completion), @@ -46,6 +48,7 @@ enum Commands { pub async fn run() -> Result<()> { let args = Cli::parse(); match args.command { + Commands::Activate(activate) => activate.run().await, Commands::Add(add) => add.run().await, Commands::Clean(clean) => clean.run().await, Commands::Completion(completion) => completion.run().await,