Get program name from command line when invoked as package

Issue #600 resolved
Ben Finney created an issue

The program name, for use in the help message, is derived from the command-line arguments — except when the command-line shows the program is the main module of a package.

        self.program_name = os.path.basename(sys.argv[0])
        if self.program_name == '':
            self.program_name = 'coverage'

The name ‘coverage’ is hard-coded, regardless of what the package actually is.

Instead, when the command-line first argument shows the program was invoked as a package, the package name should be used for the program name.

Comments (3)

  1. Log in to comment