Skip to content

Commit

Permalink
Streamline command line arguments and documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Dec 11, 2023
1 parent dd09978 commit e8b41c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Change log
0.3 (unreleased)
================

- Nothing changed yet.
- Streamline command line arguments and documentation.


0.2 (2023-12-11)
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Installation with pipx

.. code-block:: sh
pipx install .
pipx install gtimelog2tick
Usage
=====
Expand Down
17 changes: 9 additions & 8 deletions gtimelog2tick.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,7 @@ def __call__(self, value):

def show_results(
entries: Iterable[TickSyncStatus],
stdout,
verbose=0):
stdout):
totals = {
'hours': collections.defaultdict(int),
'entries': collections.defaultdict(int),
Expand All @@ -451,10 +450,12 @@ def show_results(


def _main(argv=None, stdout=sys.stdout):
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', default='~/.gtimelog/gtimelogrc')
parser.add_argument('-v', '--verbose', action='count', default=0,
help='be more verbose (can be repeated)')
parser = argparse.ArgumentParser(
epilog='--since and --until also understand the arguments today as'
' well as yesterday')
parser.add_argument(
'-c', '--config', default='~/.gtimelog/gtimelogrc',
help='path of the config file, defaults to ~/.gtimelog/gtimelogrc')
parser.add_argument(
'--dry-run',
action='store_true',
Expand All @@ -466,8 +467,8 @@ def _main(argv=None, stdout=sys.stdout):
" minus 7 days")
parser.add_argument(
'--until', type=Date(),
help="sync logs up until specified yyyy-mm-dd date, it does _not_"
" include the specified day.")
help="sync logs until specified yyyy-mm-dd date, it does _not_"
" include the specified day, there is no default.")
args = parser.parse_args(argv)

if args.since and args.until and args.since >= args.until:
Expand Down

0 comments on commit e8b41c5

Please sign in to comment.