From e777ee0979066770b7b2bcd8ddf38f47b290a726 Mon Sep 17 00:00:00 2001 From: Peter Teuben Date: Tue, 3 Oct 2023 18:57:03 -0400 Subject: [PATCH] display version in -h as well add some terminal based help --- qtrun.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/qtrun.py b/qtrun.py index 29c297c..e477950 100755 --- a/qtrun.py +++ b/qtrun.py @@ -7,7 +7,7 @@ import re import subprocess -_version = "29-sep-2023" +_version = "3-oct-2023" _debug = False class MainWindow(QtWidgets.QMainWindow): @@ -145,7 +145,12 @@ def quit(self): self.close() def help(self): - print('help') + print("Run: run the script withe the selected `key=val` arguments") + print("Save: save the key=val settings in a key file for later retrieval") + print("Load: load a keyfile previously saved") + print("Quit: quit the program") + print("Help: this help") + print("Hover with the mouse over the keyword names to get some help on the keywords") # function to create each widget from the input file def createWidgetsFromGroups(self): @@ -349,8 +354,12 @@ def parsefile(file): if __name__ == '__main__': global args # global to access args outside - parser = argparse.ArgumentParser(description="Dynamic GUI Builder") - parser.add_argument("input_file", help="Text file containing `key=val` parameters, optionally add a keyfile", default=None, nargs='*') + parser = argparse.ArgumentParser(description="Dynamic GUI Builder - version %s" % _version, + formatter_class=argparse.RawTextHelpFormatter) + + parser.add_argument("input_file", help="Script containing `key=val` parameters and #> GUI directives\n" + + "optionally add a keyfile [not implemented yet]", + default=None, nargs='*') parser.add_argument('-d', '--debug', action='store_true', help='Enable debug mode') parser.add_argument('-v', '--version', action='store_true', help='Show version')