Lines Matching +full:- +full:- +full:short
5 * short and long options are tied together
8 * options set attributes of a passed-in object
16 # the same as a Python NAME -- except, in the spirit of most GNU
17 # utilities, we use '-' in place of '_'. (The spirit of LISP lives on!)
19 longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)'
27 longopt_xlate = str.maketrans('-', '_')
32 * short and long options are tied together
35 * options set attributes of a passed-in object
36 * boolean options can have "negative aliases" -- eg. if
37 --quiet is the "negative alias" of --verbose, then "--quiet"
53 # table (ie. those 3-tuples).
59 # --foo is an alias for --bar
68 # parse the command-line, since the 'option_table' passed in here
77 # original order of options (and their values) on the command-line,
78 # but expands short options, converts aliases, etc.
145 long, short, help = option
148 long, short, help, repeat = option
154 # Type- and value-check the option names
159 if (not ((short is None) or
160 (isinstance(short, str) and len(short) == 1))):
161 raise DistutilsGetoptError("invalid short option '%s': "
162 "must a single character or None" % short)
167 if long[-1] == '=': # option takes an argument?
168 if short: short = short + ':'
169 long = long[0:-1]
182 self.long_opts[-1] = long # XXX redundant?!
206 if short:
207 self.short_opts.append(short)
208 self.short2long[short[0]] = long
211 """Parse command-line options in args. Store as attributes on object.
218 'args' is a modified copy of the passed-in 'args' list, which
238 if len(opt) == 2 and opt[0] == '-': # it's a short option
241 assert len(opt) > 2 and opt[:2] == '--'
259 # It has a negative option -q quiet, which should set verbose = 0.
292 short = option[1]
294 if long[-1] == '=':
295 l = l - 1
296 if short is not None:
297 l = l + 5 # " (-x)" where short == 'x'
304 # --foo controls foonabulation
306 # --flimflam set the flim-flam level
308 # --flimflam set the flim-flam level (must be between
310 # Options with short names will have the short name shown (but
312 # --foo (-f) controls foonabulation
313 # If adding the short option would make the left column too wide,
315 # --flimflam (-l)
316 # set the flim-flam level
318 # - 2 spaces before option block start lines
319 # - 2 dashes for each long option name
320 # - min. 2 spaces between option and explanation (gutter)
321 # - 5 characters (incl. space) for short option name
326 text_width = line_width - opt_width
334 long, short, help = option[:3]
336 if long[-1] == '=':
337 long = long[0:-1]
339 # Case 1: no short option at all (makes life easy)
340 if short is None:
342 lines.append(" --%-*s %s" % (max_opt, long, text[0]))
344 lines.append(" --%-*s " % (max_opt, long))
346 # Case 2: we have a short option, so we have to include it
349 opt_names = "%s (-%s)" % (long, short)
351 lines.append(" --%-*s %s" %
354 lines.append(" --%-*s" % opt_names)
376 """wrap_text(text : string, width : int) -> [string]
388 chunks = re.split(r'( +|-+)', text)
389 chunks = [ch for ch in chunks if ch] # ' - ' results in empty strings
393 cur_line = [] # list of chunks (to-be-joined)
404 if cur_line and cur_line[-1][0] == ' ':
405 del cur_line[-1]
410 # chunk that's too big too fit on a line -- so we break
416 # all-whitespace chunks at the end of a line can be discarded
422 # and store this line in the list-of-all-lines -- as a single
431 changing "-" to "_".
437 """Dummy class just used as a place to hold command-line option
449 Tra-la-la, supercalifragilisticexpialidocious.
451 (Someone ask Mary -- she'll know [or she'll