aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsalmonik <raisersoft@proton.me>2026-05-26 07:01:40 +0200
committersalmonik <raisersoft@proton.me>2026-05-26 07:01:40 +0200
commitb5872054f641bb417bd1ffc6a9ded1d95181b943 (patch)
tree47f129d5b5f984ebb96b6bb2ad274342e0e8c40e /src
parentbin size optimizations and queue stopping at the end of it (diff)
downloadrsplayer-b5872054f641bb417bd1ffc6a9ded1d95181b943.tar.gz
rsplayer-b5872054f641bb417bd1ffc6a9ded1d95181b943.zip
no need to ship completions anymore!
Diffstat (limited to '')
-rw-r--r--src/cli.rs18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cli.rs b/src/cli.rs
index f9a3c6f..4590f57 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1,6 +1,6 @@
1use crate::config::Config; 1use crate::config::Config;
2use crate::database::Database; 2use crate::database::Database;
3use clap::{CommandFactory, Parser, Subcommand}; 3use clap::{Command, CommandFactory, Parser, Subcommand};
4use clap_complete::{Shell, generate}; 4use clap_complete::{Shell, generate};
5use std::path::PathBuf; 5use std::path::PathBuf;
6 6
@@ -218,7 +218,21 @@ impl Cli {
218 } 218 }
219 } 219 }
220 Commands::Completions { shell } => { 220 Commands::Completions { shell } => {
221 let mut cmd = Cli::command(); 221 let full = Cli::command();
222 let subcommands: Vec<Command> = full
223 .get_subcommands()
224 .filter(|s| s.get_name() != "completions")
225 .cloned()
226 .collect();
227 let cmd_name = full.get_name().to_string();
228 let about = full.get_about().cloned();
229 let mut cmd = Command::new(cmd_name).infer_long_args(true);
230 if let Some(a) = about {
231 cmd = cmd.about(a);
232 }
233 for sc in subcommands {
234 cmd = cmd.subcommand(sc);
235 }
222 if let Some(s) = shell { 236 if let Some(s) = shell {
223 let shell = match s.as_str() { 237 let shell = match s.as_str() {
224 "bash" => Shell::Bash, 238 "bash" => Shell::Bash,