Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Dec 10, 2024
1 parent d17647a commit 7a0d8fa
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/cli/activate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# `pitchfork activate`

- **Usage**: `pitchfork activate <SHELL>`

Activate pitchfork in your shell session

Necessary for autostart/stop when entering/exiting projects with pitchfork.toml files

## Arguments

### `<SHELL>`

The shell to generate source for
26 changes: 26 additions & 0 deletions docs/cli/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@
"full_cmd": [],
"usage": "<SUBCOMMAND>",
"subcommands": {
"activate": {
"full_cmd": [
"activate"
],
"usage": "activate <SHELL>",
"subcommands": {},
"args": [
{
"name": "SHELL",
"usage": "<SHELL>",
"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"
Expand Down
1 change: 1 addition & 0 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

## Subcommands

- [`pitchfork activate <SHELL>`](/cli/activate.md)
- [`pitchfork add`](/cli/add.md)
- [`pitchfork clean`](/cli/clean.md)
- [`pitchfork completion <SHELL>`](/cli/completion.md)
Expand Down
6 changes: 6 additions & 0 deletions pitchfork.usage.kdl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name "pitchfork-cli"
bin "pitchfork"
usage "Usage: pitchfork-cli <COMMAND>"
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 "<SHELL>" help="The shell to generate source for"
}
cmd "add" help="Add a new daemon to pitchfork.toml" {
alias "a"
}
Expand Down
18 changes: 18 additions & 0 deletions src/cli/activate.rs
Original file line number Diff line number Diff line change
@@ -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!();
}
}
3 changes: 3 additions & 0 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::Result;
use clap::Parser;

mod activate;
mod add;
mod clean;
mod completion;
Expand All @@ -25,6 +26,7 @@ struct Cli {

#[derive(Debug, clap::Subcommand)]
enum Commands {
Activate(activate::Activate),
Add(add::Add),
Clean(clean::Clean),
Completion(completion::Completion),
Expand All @@ -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,
Expand Down

0 comments on commit 7a0d8fa

Please sign in to comment.