feat: compile time completion generation
Removed `completion` command in favor of compile time completion generation. This tool will only be build from source for the foreseeable future so this makes sense for now.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
use super::{Django, Docker, DockerCompose, Postgres};
|
||||
use clap::{Parser, Subcommand};
|
||||
use clap_complete::Shell;
|
||||
|
||||
/// A program for interacting with various dockerized applications.
|
||||
#[derive(Parser, Debug)]
|
||||
@@ -12,12 +11,6 @@ pub struct Ahab {
|
||||
|
||||
#[derive(Debug, Subcommand)]
|
||||
pub enum Commands {
|
||||
/// Generate completion files
|
||||
Completion {
|
||||
#[arg(value_enum)]
|
||||
shell: Shell,
|
||||
},
|
||||
|
||||
/// Docker related subcommands
|
||||
Docker {
|
||||
#[command(subcommand)]
|
||||
|
11
src/main.rs
11
src/main.rs
@@ -1,7 +1,7 @@
|
||||
use ahab::{cli, scripts};
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::{CommandFactory, Parser};
|
||||
use clap::Parser;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
// always load dotenv on start
|
||||
@@ -13,15 +13,6 @@ fn main() -> Result<()> {
|
||||
let args = cli::Ahab::parse();
|
||||
|
||||
match args.command {
|
||||
cli::Commands::Completion { shell } => {
|
||||
clap_complete::generate(
|
||||
shell,
|
||||
&mut cli::Ahab::command(),
|
||||
"ahab",
|
||||
&mut std::io::stdout(),
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
cli::Commands::Docker { command } => match command {
|
||||
cli::Docker::StopAll => scripts::docker::stop_all(),
|
||||
},
|
||||
|
Reference in New Issue
Block a user