Show uv generate-shell-completion in CLI documentation reference (#6146)

We need to follow this with:

1) Hide a bunch of global arguments for this command
2) Add an about section for the command
This commit is contained in:
Zanie Blue 2024-08-16 11:40:05 -05:00 committed by GitHub
parent d7abe827d6
commit b93b0f2bcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 88 additions and 1 deletions

View file

@ -22,6 +22,8 @@ const REPLACEMENTS: &[(&str, &str)] = &[
),
];
const SHOW_HIDDEN_COMMANDS: &[&str] = &["generate-shell-completion"];
#[derive(clap::Args)]
pub(crate) struct Args {
/// Write the generated output to stdout (rather than to `settings.md`).
@ -101,7 +103,7 @@ fn generate() -> String {
}
fn generate_command<'a>(output: &mut String, command: &'a Command, parents: &mut Vec<&'a Command>) {
if command.is_hide_set() {
if command.is_hide_set() && !SHOW_HIDDEN_COMMANDS.contains(&command.get_name()) {
return;
}