mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 15:35:52 +08: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
@ -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…
x
Reference in New Issue
Block a user