[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [patch 2/5] bash_completion: Handle spaces in file names
From: |
Jean Delvare |
Subject: |
[Quilt-dev] [patch 2/5] bash_completion: Handle spaces in file names |
Date: |
Sat, 22 Feb 2014 22:34:48 +0100 |
User-agent: |
quilt/0.61-1 |
Set IFS in _quilt_comfile so that file names containing spaces are
properly handled. Also quote address@hidden everywhere so that such
file names are preserved.
This closes Debian bug #640551.
---
bash_completion | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
--- a/bash_completion
+++ b/bash_completion
@@ -82,7 +82,8 @@ fi
#
_quilt_comfile()
{
- COMPREPLY=( address@hidden:-} $( compgen -f -- "$cur" ) )
+ local IFS=$'\t\n'
+ COMPREPLY=( "address@hidden" $( compgen -f -- "$cur" ) )
}
_quilt_completion()
@@ -126,7 +127,7 @@ _quilt_completion()
;;
*)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-P -h" -- $cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-P -h" -- $cur ) )
;;
esac
;;
@@ -137,7 +138,7 @@ _quilt_completion()
;;
*)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-P -h" -- $cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-P -h" -- $cur ) )
;;
esac
;;
@@ -159,13 +160,13 @@ _quilt_completion()
;;
*)
_filedir
- COMPREPLY=( address@hidden:-} $( compgen -W "-p -P -u -U -c -C
-R -z -h --snapshot --diff --no-timestamps --no-index --combine --sort" -- $cur
) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-p -P -u -U -c -C
-R -z -h --snapshot --diff --no-timestamps --no-index --combine --sort" -- $cur
) )
;;
esac
;;
edit)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-h" -- $cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-h" -- $cur ) )
;;
files)
case $prev in
@@ -184,7 +185,7 @@ _quilt_completion()
;;
*)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-p" -- $cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-p" -- $cur ) )
;;
esac
;;
@@ -203,7 +204,7 @@ _quilt_completion()
;;
grep)
_longopt grep
- COMPREPLY=( address@hidden:-} $( compgen -W "-h" -- $cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-h" -- $cur ) )
;;
header)
COMPREPLY=( $( compgen -W "-a -e -h -r --backup --strip-diffstat
--strip-trailing-whitespace $(quilt --quiltrc - series)" -- $cur ) )
@@ -220,7 +221,7 @@ _quilt_completion()
;;
*)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-p -P -f -d -h" --
$cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-p -P -f -d -h" --
$cur ) )
;;
esac
;;
@@ -232,7 +233,7 @@ _quilt_completion()
;;
patches)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-v -h" -- $cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-v -h" -- $cur ) )
;;
pop)
COMPREPLY=( $( compgen -W "-a -f -R -q -v -h $(quilt --quiltrc -
applied 2>/dev/null)" -- $cur ) )
@@ -259,7 +260,7 @@ _quilt_completion()
;;
*)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-P -h" -- $cur ) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-P -h" -- $cur ) )
;;
esac
;;
@@ -283,7 +284,7 @@ _quilt_completion()
;;
*)
_quilt_comfile
- COMPREPLY=( address@hidden:-} $( compgen -W "-d -v -h" -- $cur
) )
+ COMPREPLY=( "address@hidden" $( compgen -W "-d -v -h" -- $cur )
)
;;
esac
;;