mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-30 06:11:09 -07:00
Adding help arguments manually
.. and also print and exit as it normally does, when enabled.
This commit is contained in:
parent
b4aed1da22
commit
f1d5bc38dc
1 changed files with 10 additions and 2 deletions
|
|
@ -669,8 +669,16 @@ class CuraApplication(QtApplication):
|
||||||
|
|
||||||
def preRun(self):
|
def preRun(self):
|
||||||
# Last check for unknown commandline arguments
|
# Last check for unknown commandline arguments
|
||||||
parser = self.getCommandlineParser(with_help = True)
|
parser = self.getCommandlineParser()
|
||||||
parser.parse_args()
|
parser.add_argument("--help", "-h",
|
||||||
|
action='store_true',
|
||||||
|
default = False,
|
||||||
|
help = "Show this help message and exit."
|
||||||
|
)
|
||||||
|
parsed_args = vars(parser.parse_args()) # This won't allow unknown arguments
|
||||||
|
if parsed_args["help"]:
|
||||||
|
parser.print_help()
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.preRun()
|
self.preRun()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue