summaryrefslogtreecommitdiffstats
path: root/completion.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-03-06 19:47:49 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-03-06 19:52:02 +0100
commit7269bb0e809d9b517b7e47b9da109ea827f7dae0 (patch)
tree890091ef59315b8aea057bf20250d2775f053102 /completion.py
parenta6ee860c67224208451994e978b88483fcc2c0f8 (diff)
downloadclufter-7269bb0e809d9b517b7e47b9da109ea827f7dae0.tar.gz
clufter-7269bb0e809d9b517b7e47b9da109ea827f7dae0.tar.xz
clufter-7269bb0e809d9b517b7e47b9da109ea827f7dae0.zip
Formalize s/_/-/g + inverse transformation as functions
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'completion.py')
-rw-r--r--completion.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/completion.py b/completion.py
index ec8be3e..c8c67ef 100644
--- a/completion.py
+++ b/completion.py
@@ -7,7 +7,7 @@ __author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
from os.path import basename
-from .utils import args2sgpl, bifilter
+from .utils import args2sgpl, bifilter, cli_undecor
class Completion(object):
@@ -63,7 +63,7 @@ class BashCompletion(Completion):
def __init__(self, prog, *args):
prog = basename(prog)
super(BashCompletion, self).__init__(prog, *args)
- self._name = prog.replace('-', '_')
+ self._name = cli_undecor(prog)
@staticmethod
def _namespaced_identifier(namespace, name=None):
@@ -94,7 +94,7 @@ local opts="{0}"
' '.join(reduce(lambda a, b: a + list(b[0]), opts, []))
).splitlines()
- handle = handle.replace('-', '_')
+ handle = cli_undecor(handle)
return handle, self._format_function(handle, main)
def scripts_epilogue(self, handles, aliases):