From 0ce6829e4c430a2e8e4e2d3d486a8b0528039f0e Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 5 Jun 2012 13:44:59 +0200 Subject: [PATCH] Python3 fixes in make_completions.py --- make_completions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/make_completions.py b/make_completions.py index d64409f93..3c74aa316 100755 --- a/make_completions.py +++ b/make_completions.py @@ -43,7 +43,7 @@ def print_completion( cmd, switch_arr, arg, desc ): if len(switch_arr)==0: return - res = "complete -c %s" % (cmd) + res = "complete -c {0}".format(cmd) for sw in switch_arr: offset=1 @@ -56,9 +56,9 @@ def print_completion( cmd, switch_arr, arg, desc ): switch_type = "l" offset=2 - res += " -%s %s" % (switch_type, escape(sw[offset:])) + res += " -{0} {1}".format(switch_type, escape(sw[offset:])) - res += " --description '%s'" % (up_first(escape_quotes(clean(desc)))) + res += " --description '{0}'".format(up_first(escape_quotes(clean(desc)))) print(res) @@ -67,9 +67,9 @@ cmd = sys.argv[1] header(cmd) try: - man = commands.getoutput( "man %s | col -b".format(cmd)) + man = commands.getoutput( "man {0} | col -b".format(cmd)) except NameError: - man = subprocess.getoutput( "man %s | col -b".format(cmd)) + man = subprocess.getoutput( "man {0} | col -b".format(cmd)) remainder = man