mysql-admutils: fix generated completions
All checks were successful
Build and test / check (push) Successful in 2m35s
Build and test / build (push) Successful in 3m29s
Build and test / check-license (push) Successful in 4m51s
Build and test / test (push) Successful in 3m58s
Build and test / docs (push) Successful in 5m31s

There is a bug in clap dynamic completions, where it does not account
for alternative binary names. This hack should fix it for now
This commit is contained in:
2025-12-03 16:38:48 +09:00
parent 0df19654d6
commit fbf90a456a
2 changed files with 7 additions and 0 deletions

View File

@@ -18,6 +18,10 @@ mkdir -p assets/completions
COMPLETE=bash mysql-useradm > assets/completions/mysql-useradm.bash
COMPLETE=zsh mysql-useradm > assets/completions/_mysql-useradm
COMPLETE=fish mysql-useradm > assets/completions/mysql-useradm.fish
# See https://github.com/clap-rs/clap/issues/1764
sed -i 's/muscl/mysql-dbadm/g' assets/completions/{mysql-dbadm.bash,mysql-dbadm.fish,_mysql-dbadm}
sed -i 's/muscl/mysql-useradm/g' assets/completions/{mysql-useradm.bash,mysql-useradm.fish,_mysql-useradm}
)
cargo deb

View File

@@ -29,6 +29,9 @@ buildFunction {
export PATH="$out/bin:$PATH"
export COMPLETE="${shell}"
"${command}" > "$TMP/${command}.${shell}"
# See https://github.com/clap-rs/clap/issues/1764
sed -i 's/muscl/${command}/g' "$TMP/${command}.${shell}"
)
installShellCompletion "--${shell}" --cmd "${command}" "$TMP/${command}.${shell}"
'') {