MCPcopy Index your code
hub / github.com/python/cpython / set_usage

Method set_usage

Lib/optparse.py:1254–1263  ·  view source on GitHub ↗
(self, usage)

Source from the content-addressed store, hash-verified

1252 # -- Simple modifier methods ---------------------------------------
1253
1254 def set_usage(self, usage):
1255 if usage is None:
1256 self.usage = _("%prog [options]")
1257 elif usage is SUPPRESS_USAGE:
1258 self.usage = None
1259 # For backwards compatibility with Optik 1.3 and earlier.
1260 elif usage.lower().startswith("usage: "):
1261 self.usage = usage[7:]
1262 else:
1263 self.usage = usage
1264
1265 def enable_interspersed_args(self):
1266 """Set parsing to not stop on the first non-option, allowing

Callers 2

__init__Method · 0.95
test_help_old_usageMethod · 0.80

Calls 3

_Function · 0.50
startswithMethod · 0.45
lowerMethod · 0.45

Tested by 1

test_help_old_usageMethod · 0.64