Revert "add auto-generated zsh completion"

This reverts commit dca0895b39.
This commit is contained in:
steven-omaha
2023-02-24 13:25:33 +01:00
parent 6d692bcfb5
commit 93d4c58a00
6 changed files with 117 additions and 19 deletions
-1
View File
@@ -27,4 +27,3 @@ serde_derive = "1.0"
serde = "1.0"
pacdef_macros = { path = "../pacdef_macros", version = "0.1" }
clap_complete = "4.1.3"
-1
View File
@@ -5,7 +5,6 @@ use pacdef_macros::Action;
#[derive(Debug, Action)]
pub enum Actions {
Clean,
Completion,
Edit,
Import,
List,
+5 -6
View File
@@ -9,18 +9,17 @@ use crate::core::get_version_string;
/// Build the `pacdef` argument parser, with subcommands for `version`,
/// `group` and `package`.
pub fn build_cli() -> Command {
fn get_arg_parser() -> Command {
let package_cmd = get_package_cmd();
let group_cmd = get_group_cmd();
let version_cmd = Command::new(VERSION).about("show version info");
let completion_cmd = Command::new(COMPLETION).about("generate shell completion");
Command::new("pacdef")
.about("declarative package manager for Linux")
.version(get_version_string())
.subcommand_required(true)
.arg_required_else_help(true)
.subcommands([package_cmd, group_cmd, version_cmd, completion_cmd])
.subcommands([package_cmd, group_cmd, version_cmd])
}
/// Build the `pacdef group` subcommand.
@@ -68,7 +67,7 @@ fn get_group_cmd() -> Command {
Command::new("group")
.arg_required_else_help(true)
.about("manage groups")
.about("TODO????")
.visible_alias("g")
.subcommand_required(true)
.subcommands([edit, import, list, new, remove, show])
@@ -96,7 +95,7 @@ fn get_package_cmd() -> Command {
Command::new("package")
.arg_required_else_help(true)
.about("manage packages")
.about("TODO????")
.visible_alias("p")
.subcommand_required(true)
.subcommands([clean, review, unmanaged, search, sync])
@@ -105,7 +104,7 @@ fn get_package_cmd() -> Command {
/// Get and parse the CLI arguments.
#[must_use]
pub fn get() -> clap::ArgMatches {
build_cli().get_matches()
get_arg_parser().get_matches()
}
/// For each file argument, return the absolute path to the file.
-1
View File
@@ -84,7 +84,6 @@ impl Pacdef {
},
Some((VERSION, _)) => Ok(self.show_version()),
Some((COMPLETION, _)) => generate_shell_completion(),
Some((_, _)) => panic!("{ACTION_NOT_MATCHED}"),
None => unreachable!("{UNREACHABLE_ARM}"),