Return True if command line does not contain any help or display requests.
(_cache=None)
| 71 | raise TypeError(repr(type(dv))) |
| 72 | |
| 73 | def _command_line_ok(_cache=None): |
| 74 | """ Return True if command line does not contain any |
| 75 | help or display requests. |
| 76 | """ |
| 77 | if _cache: |
| 78 | return _cache[0] |
| 79 | elif _cache is None: |
| 80 | _cache = [] |
| 81 | ok = True |
| 82 | display_opts = ['--'+n for n in Distribution.display_option_names] |
| 83 | for o in Distribution.display_options: |
| 84 | if o[1]: |
| 85 | display_opts.append('-'+o[1]) |
| 86 | for arg in sys.argv: |
| 87 | if arg.startswith('--help') or arg=='-h' or arg in display_opts: |
| 88 | ok = False |
| 89 | break |
| 90 | _cache.append(ok) |
| 91 | return ok |
| 92 | |
| 93 | def get_distribution(always=False): |
| 94 | dist = distutils.core._setup_distribution |