feat: add clap_complete for generating completion files

`ahab generate <shell>` can now be used to generte completion files for
this tool.
This commit is contained in:
2023-05-27 13:26:35 +02:00
parent a9a5e401dc
commit 61e7556997
4 changed files with 28 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
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)]
@@ -11,6 +12,12 @@ pub struct Ahab {
#[derive(Debug, Subcommand)]
pub enum Commands {
/// Generate completion files
Completion {
#[arg(value_enum)]
shell: Shell,
},
/// Docker related subcommands
D {
#[command(subcommand)]