From 85295934531847bed2e9aee7d3bc1c339359ac8e Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Tue, 7 May 2019 17:49:07 -0700 Subject: [PATCH] Rename --show-time-today to --today --- tests/samples/output/common_usage_header | 2 +- tests/samples/output/test_help_contents | 2 +- tests/test_arguments.py | 2 +- wakatime/arguments.py | 4 ++-- wakatime/main.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/samples/output/common_usage_header b/tests/samples/output/common_usage_header index 16de27a..e41dce9 100644 --- a/tests/samples/output/common_usage_header +++ b/tests/samples/output/common_usage_header @@ -10,4 +10,4 @@ usage: wakatime [-h] [--entity FILE] [--key KEY] [--write] [--plugin PLUGIN] [--include-only-with-project-file] [--extra-heartbeats] [--log-file LOG_FILE] [--api-url API_URL] [--timeout TIMEOUT] [--sync-offline-activity SYNC_OFFLINE_ACTIVITY] - [--show-time-today] [--config CONFIG] [--verbose] [--version] + [--today] [--config CONFIG] [--verbose] [--version] diff --git a/tests/samples/output/test_help_contents b/tests/samples/output/test_help_contents index de3820c..93603a5 100644 --- a/tests/samples/output/test_help_contents +++ b/tests/samples/output/test_help_contents @@ -76,7 +76,7 @@ optional arguments: sent while online 5 offline heartbeats are synced. Can be used without --entity to only sync offline activity without generating new heartbeats. - --show-time-today Prints dashboard time for Today, then exits. + --today Prints dashboard time for Today, then exits. --config CONFIG Defaults to ~/.wakatime.cfg. --verbose Turns on debug messages in log file. --version show program's version number and exit diff --git a/tests/test_arguments.py b/tests/test_arguments.py index 2cd29b4..79ba113 100644 --- a/tests/test_arguments.py +++ b/tests/test_arguments.py @@ -329,7 +329,7 @@ class ArgumentsTestCase(TestCase): self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].return_value = SummaryResponse() config = 'tests/samples/configs/good_config.cfg' - args = ['--config', config, '--show-time-today', '--verbose'] + args = ['--config', config, '--today', '--verbose'] retval = execute(args) diff --git a/wakatime/arguments.py b/wakatime/arguments.py index 1e41c98..035127d 100644 --- a/wakatime/arguments.py +++ b/wakatime/arguments.py @@ -201,7 +201,7 @@ def parse_arguments(): 'online 5 offline heartbeats are synced. Can ' + 'be used without --entity to only sync offline ' + 'activity without generating new heartbeats.') - parser.add_argument('--show-time-today', dest='show_time_today', + parser.add_argument('--today', dest='today', action='store_true', help='Prints dashboard time for Today, then exits.') parser.add_argument('--config', dest='config', action=StoreWithoutQuotes, @@ -248,7 +248,7 @@ def parse_arguments(): if not args.entity: if args.file: args.entity = args.file - elif (not args.sync_offline_activity or args.sync_offline_activity == 'none') and not args.show_time_today: + elif (not args.sync_offline_activity or args.sync_offline_activity == 'none') and not args.today: parser.error('argument --entity is required') if not args.sync_offline_activity: diff --git a/wakatime/main.py b/wakatime/main.py index c61f108..02a40dc 100644 --- a/wakatime/main.py +++ b/wakatime/main.py @@ -42,7 +42,7 @@ def execute(argv=None): setup_logging(args, __version__) - if args.show_time_today: + if args.today: text, retval = get_time_today(args) if text: print(text)