##// END OF EJS Templates
add single '-' prefix for length 1 aliases and flags to help output
MinRK -
Show More
@@ -210,6 +210,8 b' class Application(SingletonConfigurable):'
210 help = cls.class_get_trait_help(trait).splitlines()
210 help = cls.class_get_trait_help(trait).splitlines()
211 # reformat first line
211 # reformat first line
212 help[0] = help[0].replace(longname, alias) + ' (%s)'%longname
212 help[0] = help[0].replace(longname, alias) + ' (%s)'%longname
213 if len(alias) == 1:
214 help[0] = help[0].replace('--%s='%alias, '-%s '%alias)
213 lines.extend(help)
215 lines.extend(help)
214 # lines.append('')
216 # lines.append('')
215 print os.linesep.join(lines)
217 print os.linesep.join(lines)
@@ -221,7 +223,8 b' class Application(SingletonConfigurable):'
221
223
222 lines = []
224 lines = []
223 for m, (cfg,help) in self.flags.iteritems():
225 for m, (cfg,help) in self.flags.iteritems():
224 lines.append('--'+m)
226 prefix = '--' if len(m) > 1 else '-'
227 lines.append(prefix+m)
225 lines.append(indent(dedent(help.strip())))
228 lines.append(indent(dedent(help.strip())))
226 # lines.append('')
229 # lines.append('')
227 print os.linesep.join(lines)
230 print os.linesep.join(lines)
General Comments 0
You need to be logged in to leave comments. Login now