From 81aec249488b7183bea9ddc110bfcfd57524463f Mon Sep 17 00:00:00 2001 From: Christophe Vu-Brugier Date: Sun, 15 Nov 2015 11:46:33 +0100 Subject: Fix completion of IPv6 portals Allow square brackets in parameters and remove them from readline's set_completer_delims() so that readline does not remove the square brackets from the "text" argument in _complete_token_pparam() This patch fixes issue #20. Signed-off-by: Christophe Vu-Brugier --- configshell/shell.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configshell/shell.py b/configshell/shell.py index 0cf6141..32701ec 100644 --- a/configshell/shell.py +++ b/configshell/shell.py @@ -107,7 +107,7 @@ class ConfigShell(object): # Grammar of the command line command = locatedExpr(Word(alphanums + '_'))('command') - var = Word(alphanums + '_\+/.<>()~@:-%]') + var = Word(alphanums + '_\+/.<>()~@:-%[]') value = var keyword = Word(alphanums + '_\-') kparam = locatedExpr(keyword + Suppress('=') + Optional(value, default=''))('kparams*') @@ -122,7 +122,7 @@ class ConfigShell(object): self._parser = parser if tty: - readline.set_completer_delims('\t\n ~!#$^&()[{]}\|;\'",?') + readline.set_completer_delims('\t\n ~!#$^&(){}\|;\'",?') readline.set_completion_display_matches_hook( self._display_completions) -- cgit v1.2.1