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 abf421c commit b606294
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/cli/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::Result;
use duct::cmd;
use miette::IntoDiagnostic;

/// Generates shell completion scripts
#[derive(Debug, clap::Args)]
#[clap()]
pub struct Completion {
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions src/cli/config/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use crate::Result;

mod add;
mod remove;

/// manage/edit pitchfork.toml files
#[derive(Debug, clap::Args)]
pub struct Config {
#[clap(subcommand)]
command: Commands,
}

#[derive(Debug, clap::Subcommand)]
enum Commands {
Add(add::Add),
Remove(remove::Remove),
}

impl Config {
pub async fn run(self) -> Result<()> {
match self.command {
Commands::Add(add) => add.run().await,
Commands::Remove(remove) => remove.run().await,
}
}
}
File renamed without changes.
9 changes: 3 additions & 6 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ use crate::Result;
use clap::Parser;

mod activate;
mod add;
mod cd;
mod clean;
mod completion;
mod config;
mod disable;
mod enable;
mod list;
mod logs;
mod remove;
mod run;
mod start;
mod status;
Expand All @@ -28,15 +27,14 @@ struct Cli {
#[derive(Debug, clap::Subcommand)]
enum Commands {
Activate(activate::Activate),
Add(add::Add),
Cd(cd::Cd),
Clean(clean::Clean),
Config(config::Config),
Completion(completion::Completion),
Disable(disable::Disable),
Enable(enable::Enable),
List(list::List),
Logs(logs::Logs),
Remove(remove::Remove),
Run(run::Run),
Start(start::Start),
Status(status::Status),
Expand All @@ -51,15 +49,14 @@ 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::Cd(cd) => cd.run().await,
Commands::Clean(clean) => clean.run().await,
Commands::Config(config) => config.run().await,
Commands::Completion(completion) => completion.run().await,
Commands::Disable(disable) => disable.run().await,
Commands::Enable(enable) => enable.run().await,
Commands::List(list) => list.run().await,
Commands::Logs(logs) => logs.run().await,
Commands::Remove(remove) => remove.run().await,
Commands::Run(run) => run.run().await,
Commands::Start(start) => start.run().await,
Commands::Status(status) => status.run().await,
Expand Down
1 change: 1 addition & 0 deletions src/cli/supervisor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod start;
mod status;
mod stop;

/// Start, stop, and check the status of the pitchfork supervisor daemon
#[derive(Debug, clap::Args)]
pub struct Supervisor {
#[clap(subcommand)]
Expand Down

0 comments on commit b606294

Please sign in to comment.