diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-10-06 17:18:38 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2011-10-06 17:18:38 +0100 |
commit | c0f8d49b223ec6ec05783eac1a6b3710d70dc4f7 (patch) | |
tree | ac7f9cfcf24053f5f2bfe3106269ff49daed5911 /tools/libxl/bash-completion | |
parent | f030f8c6d18f99fc627420a3484ff7bfba1ebf16 (diff) | |
download | xen-c0f8d49b223ec6ec05783eac1a6b3710d70dc4f7.tar.gz xen-c0f8d49b223ec6ec05783eac1a6b3710d70dc4f7.tar.bz2 xen-c0f8d49b223ec6ec05783eac1a6b3710d70dc4f7.zip |
xl: wrap help output if command name is too long
Without this in the "xl help" line for pci-list-assignable-devices the command
name merges with the first word of the help. Since the bash completion support
parses "xl help" this leads to "pci-list-assignable-devicesList" being
presented as an option instead of the correct command name.
We also need to filter out lines which start with more than one space in the
bash completion support to stop "List" appearing as a possible command name
after the change to wrap it.
Doesn't address the fact that some help text overflows 80 columns.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/bash-completion')
-rw-r--r-- | tools/libxl/bash-completion | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/bash-completion b/tools/libxl/bash-completion index b184f7494d..513d28e9b6 100644 --- a/tools/libxl/bash-completion +++ b/tools/libxl/bash-completion @@ -11,7 +11,7 @@ _xl() xl=xl if [[ $COMP_CWORD == 1 ]] ; then - opts=`${xl} help 2>/dev/null | sed '1,4d' | awk '{print $1}' | sed 's/$/ ,/g'` && COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + opts=`${xl} help 2>/dev/null | sed '1,4d' | awk '/^ [^ ]/ {print $1}' | sed 's/$/ ,/g'` && COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 fi |