diff --git a/setup/README.md b/setup/README.md index aba09a9..ee383e3 100644 --- a/setup/README.md +++ b/setup/README.md @@ -21,11 +21,29 @@ If you see something like: $ python swc-installation-test-2.py check virtual-shell... fail … - For instructings on installing a particular package, - see the failure message for that package printed above. + check for command line shell (virtual-shell) failed: + command line shell (virtual-shell) requires at least one of the following dependencies + For instructions on installing an up-to-date version, see + http://software-carpentry.org/setup/ + causes: + check for Bourne Again Shell (bash) failed: + could not find 'bash' executable for Bourne Again Shell (bash) + For instructions on installing an up-to-date version, see + http://software-carpentry.org/setup/ … -follow the suggestions to try and install any missing software. +follow the suggestions to try and install any missing software. For +additional troubleshooting information, you can use the `--verbose` +option: + + $ python swc-installation-test-2.py --verbose + check virtual-shell... fail + … + ================== + System information + ================== + os.name : posix + … Instructors =========== diff --git a/setup/swc-installation-test-2.py b/setup/swc-installation-test-2.py index 16a10ee..8449429 100755 --- a/setup/swc-installation-test-2.py +++ b/setup/swc-installation-test-2.py @@ -799,8 +799,18 @@ def print_suggestions(instructor_fallback=True): if __name__ == '__main__': + import optparse as _optparse + + parser = _optparse.OptionParser(usage='%prog [options] [check...]') + epilog = __doc__ + parser.format_epilog = lambda formatter: '\n' + epilog + parser.add_option( + '-v', '--verbose', action='store_true', + help=('print additional information to help troubleshoot ' + 'installation issues')) + options,args = parser.parse_args() try: - passed = check(_sys.argv[1:]) + passed = check(args) except InvalidCheck as e: print("I don't know how to check for {0!r}".format(e.check)) print('I do know how to check for:') @@ -812,7 +822,8 @@ def print_suggestions(instructor_fallback=True): print(' {0}'.format(key)) _sys.exit(1) if not passed: - print() - print_system_info() - print_suggestions(instructor_fallback=True) + if options.verbose: + print() + print_system_info() + print_suggestions(instructor_fallback=True) _sys.exit(1)