Proper naming and help text
This commit is contained in:
parent
ebe9548fb3
commit
5cf69dcee5
26
tx
26
tx
@ -33,26 +33,26 @@ def get_total(filename):
|
||||
return total_time
|
||||
|
||||
# Parse command line arguments
|
||||
parser = argparse.ArgumentParser(prog='time.txt', description="Description")
|
||||
subparsers = parser.add_subparsers(help='sub-command help', dest='mode')
|
||||
parser = argparse.ArgumentParser(prog='time.txt', description="simple plain-text time tracking.")
|
||||
subparsers = parser.add_subparsers(help='Commands', dest='mode')
|
||||
|
||||
parser.add_argument("-f", "--file")
|
||||
parser.add_argument("-f", "--file", help="a file in the time.txt format. default: ./time.txt")
|
||||
|
||||
# create the parser for the "a" command
|
||||
parser_a = subparsers.add_parser('total', help='a help')
|
||||
parser_total = subparsers.add_parser('total', help='print the total unbilled time. (default)')
|
||||
|
||||
# create the parser for the "b" command
|
||||
parser_b = subparsers.add_parser('add', help='b help')
|
||||
parser_b.add_argument("date", nargs='?', default=get_current_date())
|
||||
parser_b.add_argument("time")
|
||||
parser_b.add_argument("description")
|
||||
parser_add = subparsers.add_parser('add', help='add a time entry.')
|
||||
parser_add.add_argument("date", nargs='?', default=get_current_date(), help="date in the format 2020-12-30. defaults to the current date.")
|
||||
parser_add.add_argument("time", help="time in the format 19:20.")
|
||||
parser_add.add_argument("description", help="short description of how the time was spent.")
|
||||
|
||||
parser_b = subparsers.add_parser('bill', help='b help')
|
||||
parser_b.add_argument("date", nargs='?', default=get_current_date())
|
||||
parser_b.add_argument("time")
|
||||
parser_b.add_argument("description")
|
||||
parser_bill = subparsers.add_parser('bill', help='add a bill entry (a negative time entry).')
|
||||
parser_bill.add_argument("date", nargs='?', default=get_current_date(), help="date in the format 2020-12-30. defaults to the current date.")
|
||||
parser_bill.add_argument("time", help="time in the format 19:20.")
|
||||
parser_bill.add_argument("description", help="short description of how the time was spent.")
|
||||
|
||||
parser_c = subparsers.add_parser('create', help='b help')
|
||||
parser_create = subparsers.add_parser('create', help='create a new time.txt file.')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user