Skip to content

Commit 572afb8

Browse files
committed
fix(patch, truncate): Get help correctly on macos
The usage output on macos is in bsd style, not gnu style Also other bsd types OSs
1 parent 5b171c6 commit 572afb8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

completions/patch

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ _comp_cmd_patch()
5050
[[ $was_split ]] && return
5151

5252
if [[ $cur == -* ]]; then
53-
_comp_compgen_help
53+
# lowercasing
54+
if [[ ${OSTYPE,,} == *@(darwin|bsd)* ]]; then
55+
_comp_compgen_usage
56+
else
57+
_comp_compgen_help
58+
fi
5459
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
5560
return
5661
fi

completions/truncate

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ _comp_cmd_truncate()
2020
[[ $was_split ]] && return
2121

2222
if [[ $cur == -* ]]; then
23-
_comp_compgen_help
23+
# lowercasing
24+
if [[ ${OSTYPE,,} == *@(darwin|bsd)* ]]; then
25+
_comp_compgen_usage
26+
else
27+
_comp_compgen_help
28+
fi
2429
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
2530
return
2631
fi

0 commit comments

Comments
 (0)