mirror of
https://github.com/spf13/cobra
synced 2025-05-05 12:57:22 +00:00
style(bash-v2): remove unnecessary trailing linefeed removal
No longer needed as of f464d6c82e
, saves
a subshell.
This commit is contained in:
parent
966d0a8b85
commit
aa6017008a
1 changed files with 1 additions and 2 deletions
|
@ -132,9 +132,8 @@ __%[1]s_process_completion_results() {
|
||||||
elif (((directive & shellCompDirectiveFilterDirs) != 0)); then
|
elif (((directive & shellCompDirectiveFilterDirs) != 0)); then
|
||||||
# File completion for directories only
|
# File completion for directories only
|
||||||
|
|
||||||
# Use printf to strip any trailing newline
|
|
||||||
local subdir
|
local subdir
|
||||||
subdir=$(printf "%%s" "${completions[0]}")
|
subdir=${completions[0]}
|
||||||
if [[ -n $subdir ]]; then
|
if [[ -n $subdir ]]; then
|
||||||
__%[1]s_debug "Listing directories in $subdir"
|
__%[1]s_debug "Listing directories in $subdir"
|
||||||
pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
|
pushd "$subdir" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return
|
||||||
|
|
Loading…
Add table
Reference in a new issue