summaryrefslogtreecommitdiff
path: root/src/dynamic/shells
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-02 22:06:16 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-02-02 22:06:16 +0000
commit40c82bbbef9536ef86cb84fb53950ca655de90f2 (patch)
tree1d693e1cdf2ace296ebacf893aa7293deafa8a62 /src/dynamic/shells
parentf0eba62f7c65672e37713530fe123fe47fb93921 (diff)
parentfc66cf0e5917c166989360408d265133020fd510 (diff)
downloadclap_complete-40c82bbbef9536ef86cb84fb53950ca655de90f2.tar.gz
Snap for 11399400 from fc66cf0e5917c166989360408d265133020fd510 to sdk-release
Change-Id: Ic464c4b478f1283d22c7157d6bb386ca4f8ff5d0
Diffstat (limited to 'src/dynamic/shells')
-rw-r--r--src/dynamic/shells/bash.rs2
-rw-r--r--src/dynamic/shells/fish.rs2
-rw-r--r--src/dynamic/shells/mod.rs6
-rw-r--r--src/dynamic/shells/shell.rs2
4 files changed, 9 insertions, 3 deletions
diff --git a/src/dynamic/shells/bash.rs b/src/dynamic/shells/bash.rs
index 43c128e..1308e67 100644
--- a/src/dynamic/shells/bash.rs
+++ b/src/dynamic/shells/bash.rs
@@ -1,6 +1,6 @@
use unicode_xid::UnicodeXID as _;
-/// Bash completions
+/// Completion support for Bash
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct Bash;
diff --git a/src/dynamic/shells/fish.rs b/src/dynamic/shells/fish.rs
index 9d7e8c6..cfb9519 100644
--- a/src/dynamic/shells/fish.rs
+++ b/src/dynamic/shells/fish.rs
@@ -1,4 +1,4 @@
-/// Fish completions
+/// Completion support for Fish
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct Fish;
diff --git a/src/dynamic/shells/mod.rs b/src/dynamic/shells/mod.rs
index 54d23a3..6cfed97 100644
--- a/src/dynamic/shells/mod.rs
+++ b/src/dynamic/shells/mod.rs
@@ -13,20 +13,26 @@ use std::io::Write as _;
use crate::dynamic::Completer as _;
+/// A subcommand definition to `flatten` into your CLI
+///
+/// This provides a one-stop solution for integrating completions into your CLI
#[derive(clap::Subcommand)]
#[allow(missing_docs)]
#[derive(Clone, Debug)]
+#[command(about = None, long_about = None)]
pub enum CompleteCommand {
/// Register shell completions for this program
#[command(hide = true)]
Complete(CompleteArgs),
}
+/// Generally used via [`CompleteCommand`]
#[derive(clap::Args)]
#[command(arg_required_else_help = true)]
#[command(group = clap::ArgGroup::new("complete").multiple(true).conflicts_with("register"))]
#[allow(missing_docs)]
#[derive(Clone, Debug)]
+#[command(about = None, long_about = None)]
pub struct CompleteArgs {
/// Specify shell to complete for
#[arg(long)]
diff --git a/src/dynamic/shells/shell.rs b/src/dynamic/shells/shell.rs
index a9f48ce..c36d2a2 100644
--- a/src/dynamic/shells/shell.rs
+++ b/src/dynamic/shells/shell.rs
@@ -4,7 +4,7 @@ use std::str::FromStr;
use clap::builder::PossibleValue;
use clap::ValueEnum;
-/// Shell with auto-generated completion script available.
+/// Completion support for built-in shells
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
#[non_exhaustive]
pub enum Shell {