Skip to content

Commit

Permalink
fix: make --include-bash-completion-lib work
Browse files Browse the repository at this point in the history
Fixes #201
  • Loading branch information
jdx committed Dec 18, 2024
1 parent 7feeb24 commit c833bb4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/src/complete/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ pub fn complete_bash(opts: &CompleteOptions) -> String {
out.push(include_str!("../../bash-completion/bash_completion").to_string());
out.push("\n".to_string());
};
let mut out = vec![format!(
out.push(format!(
r#"_{bin_snake}() {{
if ! command -v {usage_bin} &> /dev/null; then
echo >&2
echo "Error: {usage_bin} CLI not found. This is required for completions to work in {bin}." >&2
echo "See https://usage.jdx.dev for more information." >&2
return 1
fi"#
)];
fi"#));

if let Some(usage_cmd) = &opts.usage_cmd {
out.push(format!(
Expand Down

0 comments on commit c833bb4

Please sign in to comment.