mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
Fix trailing whitespaces in fish comp scripts
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
bd3c9bace2
commit
92df029615
1 changed files with 2 additions and 2 deletions
|
@ -152,11 +152,11 @@ function __%[1]s_prepare_completions
|
||||||
# We don't need descriptions anyway since there is only a single
|
# We don't need descriptions anyway since there is only a single
|
||||||
# real completion which the shell will expand immediately.
|
# real completion which the shell will expand immediately.
|
||||||
set -l split (string split --max 1 \t $__%[1]s_comp_results[1])
|
set -l split (string split --max 1 \t $__%[1]s_comp_results[1])
|
||||||
|
|
||||||
# Fish won't add a space if the completion ends with any
|
# Fish won't add a space if the completion ends with any
|
||||||
# of the following characters: @=/:.,
|
# of the following characters: @=/:.,
|
||||||
set -l lastChar (string sub -s -1 -- $split)
|
set -l lastChar (string sub -s -1 -- $split)
|
||||||
if not string match -r -q "[@=/:.,]" -- "$lastChar"
|
if not string match -r -q "[@=/:.,]" -- "$lastChar"
|
||||||
# In other cases, to support the "nospace" directive we trick the shell
|
# In other cases, to support the "nospace" directive we trick the shell
|
||||||
# by outputting an extra, longer completion.
|
# by outputting an extra, longer completion.
|
||||||
__%[1]s_debug "Adding second completion to perform nospace directive"
|
__%[1]s_debug "Adding second completion to perform nospace directive"
|
||||||
|
|
Loading…
Add table
Reference in a new issue