From 5cf69dcee53b5c9ee14d9ad72a46b70e230bd3de Mon Sep 17 00:00:00 2001 From: karl Date: Tue, 15 Dec 2020 21:51:24 +0100 Subject: [PATCH] Proper naming and help text --- tx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tx b/tx index 5a8ad83..e1c332e 100755 --- a/tx +++ b/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()