Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/assets/completions/usage.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @generated by usage-cli from usage spec
_usage() {
if ! type -p usage &> /dev/null; then
if ! type -P usage &> /dev/null; then
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in usage." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down
2 changes: 1 addition & 1 deletion cli/assets/completions/usage.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @generated by usage-cli from usage spec

# if "usage" is not installed show an error
if ! type -p usage &> /dev/null
if ! type -P usage &> /dev/null
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in usage." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down
4 changes: 2 additions & 2 deletions lib/src/complete/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn complete_bash(opts: &CompleteOptions) -> String {
};
out.push(format!(
r#"_{bin_snake}() {{
if ! type -p {usage_bin} &> /dev/null; then
if ! type -P {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
Expand Down Expand Up @@ -149,7 +149,7 @@ _usage_default_complete() {{
if [[ -n "$cmdpath" && -f "$cmdpath" ]]; then
local first
if IFS= read -r first < "$cmdpath" 2>/dev/null && [[ "$first" == "#!"*"usage"* ]]; then
if type -p {usage_bin} &> /dev/null; then
if type -P {usage_bin} &> /dev/null; then
local IFS=$'\n'
# shellcheck disable=SC2207
COMPREPLY=( $(command {usage_bin} complete-word --shell bash -f "$cmdpath" --cword="$COMP_CWORD" -- "${{COMP_WORDS[@]}}") )
Expand Down
2 changes: 1 addition & 1 deletion lib/src/complete/fish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn complete_fish(opts: &CompleteOptions) -> String {
format!(
r#"
# if "{usage_bin}" is not installed show an error
if ! type -p {usage_bin} &> /dev/null
if ! type -P {usage_bin} &> /dev/null
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: "complete_bash(&CompleteOptions\n{\n usage_bin: \"usage\".to_stri
---
# @generated by usage-cli from usage spec
_mycli() {
if ! type -p usage &> /dev/null; then
if ! type -P usage &> /dev/null; then
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in mycli." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: "complete_bash(&CompleteOptions\n{\n usage_bin: \"usage\".to_stri
---
# @generated by usage-cli from usage spec
_mycli() {
if ! type -p usage &> /dev/null; then
if ! type -P usage &> /dev/null; then
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in mycli." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ expression: "complete_bash(&CompleteOptions\n{\n usage_bin: \"usage\".to_stri
---
# @generated by usage-cli from usage spec
_mycli() {
if ! type -p usage &> /dev/null; then
if ! type -P usage &> /dev/null; then
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in mycli." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ _usage_default_complete() {
if [[ -n "$cmdpath" && -f "$cmdpath" ]]; then
local first
if IFS= read -r first < "$cmdpath" 2>/dev/null && [[ "$first" == "#!"*"usage"* ]]; then
if type -p usage &> /dev/null; then
if type -P usage &> /dev/null; then
local IFS=$'\n'
# shellcheck disable=SC2207
COMPREPLY=( $(command usage complete-word --shell bash -f "$cmdpath" --cword="$COMP_CWORD" -- "${COMP_WORDS[@]}") )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ expression: "complete_fish(&CompleteOptions\n{\n usage_bin: \"usage\".to_stri
# @generated by usage-cli from usage spec

# if "usage" is not installed show an error
if ! type -p usage &> /dev/null
if ! type -P usage &> /dev/null
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in mycli." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ expression: "complete_fish(&CompleteOptions\n{\n usage_bin: \"usage\".to_stri
# @generated by usage-cli from usage spec

# if "usage" is not installed show an error
if ! type -p usage &> /dev/null
if ! type -P usage &> /dev/null
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in mycli." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ expression: "complete_fish(&CompleteOptions\n{\n usage_bin: \"usage\".to_stri
# @generated by usage-cli from usage spec

# if "usage" is not installed show an error
if ! type -p usage &> /dev/null
if ! type -P usage &> /dev/null
echo >&2
echo "Error: usage CLI not found. This is required for completions to work in mycli." >&2
echo "See https://usage.jdx.dev for more information." >&2
Expand Down