update manpage, update parameter descriptions

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2013-04-29 14:27:19 +02:00
parent 2f2f774e8d
commit e6e1ffbbf8
2 changed files with 62 additions and 20 deletions

28
bin/ctt
View file

@ -37,10 +37,10 @@ def parse_argv(argv, version):
parser = {} parser = {}
parser['loglevel'] = argparse.ArgumentParser(add_help=False) parser['loglevel'] = argparse.ArgumentParser(add_help=False)
parser['loglevel'].add_argument('-d', '--debug', parser['loglevel'].add_argument('-d', '--debug',
help='Set log level to debug', action='store_true', help='set log level to debug', action='store_true',
default=False) default=False)
parser['loglevel'].add_argument('-v', '--verbose', parser['loglevel'].add_argument('-v', '--verbose',
help='Set log level to info, be more verbose', help='set log level to info, be more verbose',
action='store_true', default=False) action='store_true', default=False)
parser['main'] = argparse.ArgumentParser(description='ctt ' + version, parser['main'] = argparse.ArgumentParser(description='ctt ' + version,
@ -55,27 +55,27 @@ def parse_argv(argv, version):
parser['track'] = parser['sub'].add_parser('track', parser['track'] = parser['sub'].add_parser('track',
parents=[parser['loglevel']]) parents=[parser['loglevel']])
parser['track'].set_defaults(func=Tracker.commandline) parser['track'].set_defaults(func=Tracker.commandline)
parser['track'].add_argument("-s", "--start", help="Start datetime (format: %s)" % ctt.DATETIMEFORMAT_PLAIN, parser['track'].add_argument("--sd", "--start", help="start date (default: first of this month, format: %s)" % ctt.DATEFORMAT_PLAIN,
nargs=1) nargs=1, dest="start")
parser['track'].add_argument("-e", "--end", help="End datetime (format: %s)" % ctt.DATETIMEFORMAT_PLAIN, parser['track'].add_argument("--ed", "--end", help="end date (default: last of this month, format: %s)" % ctt.DATEFORMAT_PLAIN,
nargs=1) nargs=1, default=None, dest="end")
parser['track'].add_argument("-n", "--no-comment", help="Disable comment prompting after tracking", parser['track'].add_argument("-n", "--no-comment", help="disable comment prompting after tracking",
action='store_false', dest="comment") action='store_false', dest="comment")
parser['track'].add_argument("project", help="Project to track time for", nargs=1) parser['track'].add_argument("project", help="project to track time for", nargs=1)
parser['report'] = parser['sub'].add_parser('report', parser['report'] = parser['sub'].add_parser('report',
parents=[parser['loglevel']]) parents=[parser['loglevel']])
parser['report'].set_defaults(func=Report.commandline) parser['report'].set_defaults(func=Report.commandline)
parser['report'].add_argument("project", help="Project to report time for", nargs=1) parser['report'].add_argument("project", help="project to report time for", nargs=1)
parser['report'].add_argument("--sd", "--start", help="Start date (default: first of last month, format: %s)" % ctt.DATEFORMAT_PLAIN, parser['report'].add_argument("--sd", "--start", help="start date (default: first of this month, format: %s)" % ctt.DATEFORMAT_PLAIN,
nargs=1, dest="start") nargs=1, dest="start")
parser['report'].add_argument("--ed", "--end", help="End date (default: last of last month, format: %s)" % ctt.DATEFORMAT_PLAIN, parser['report'].add_argument("--ed", "--end", help="end date (default: last of this month, format: %s)" % ctt.DATEFORMAT_PLAIN,
nargs=1, default=None, dest="end") nargs=1, default=None, dest="end")
parser['report'].add_argument("-e", "--regexp", help="Regular expression to match", parser['report'].add_argument("-e", "--regexp", help="regular expression to match",
default=None) default=None)
parser['report'].add_argument("-i", "--ignore-case", help="Ignore case distinctions", action="store_true") parser['report'].add_argument("-i", "--ignore-case", help="ignore case distinctions", action="store_true")
parser['report'].add_argument("-f", "--format", help="Output format (default: %s)" % ctt.REPORTFORMAT, parser['report'].add_argument("-f", "--format", help="output format (default: %s)" % ctt.REPORTFORMAT,
default=ctt.REPORTFORMAT, dest="output_format") default=ctt.REPORTFORMAT, dest="output_format")
#parser['track'].add_argument("-t", "--tag", help="Add tags", #parser['track'].add_argument("-t", "--tag", help="Add tags",

View file

@ -29,6 +29,8 @@ in a cconfig database.
GENERAL OPTIONS GENERAL OPTIONS
--------------- ---------------
The following parameters are available to all subcommands:
-h, --help:: -h, --help::
show this help message and exit show this help message and exit
-d, --debug:: -d, --debug::
@ -40,25 +42,47 @@ GENERAL OPTIONS
TRACK TRACK
----- -----
Tracking is started by using the **track** subcommand. Tracking is started by using the **track** subcommand.
It requires a project name to track time for. It requires the project name to track time for.
Without any options it stays in the foreground and waits until Without any options it stays in the foreground and waits until
enter is pressed and then prompts for a comment. enter is pressed and then prompts for a comment.
Available parameters:
-s START, --start START:: --sd START, --start START::
start datetime (format: Y-m-d-HM) start date (default: first of this month, format: Y-m-d)
-e END, --end END:: --ed END, --end END::
end datetime (format: Y-m-d-HM) end date (default: last of this month, format: Y-m-d)
-n, --no-comment:: -n, --no-comment::
disable comment prompting after tracking disable comment prompting after tracking
REPORT REPORT
------ ------
Reporting is handled by the **report** subcommand.
It requires the project name to report time for.
It supports to filter entries using regular expressions
and also allows to use a custom output format.
Available parameters:
--sd START, --start START::
start date (default: first of this month, format: Y-m-d)
--ed END, --end END::
end date (default: last of this month, format: Y-m-d)
-e REGEXP, --regexp REGEXP::
regular expression to match
-i, --ignore-case::
ignore case distinctions
-f OUTPUT_FORMAT, --format OUTPUT_FORMAT::
output format (default: {0} ({1}): {2})
LISTPROJECTS LISTPROJECTS
------------ ------------
The **listprojects** subcommand is used to list used projects.
It does not expect any parameters.
EXAMPLES EXAMPLES
-------- --------
@ -79,6 +103,23 @@ Comment: Started early today
# Track without prompting for a comment # Track without prompting for a comment
% ctt track -n test % ctt track -n test
# List available projects
% ctt listprojects
[...]
# List all entries of this month for project test
% ctt report test
[...]
# List all entries from January
% ctt report --sd 2013-01-01 --ed 2013-01-31 test
# List all entries from January matching either rails ruby or cdist
% ctt report --sd 2013-01-29 --ed 2013-04-29 -e "(rails|ruby|cdist)" test
# The same, but case insensitive
% ctt report --sd 2013-01-29 --ed 2013-04-29 -e "(rails|ruby|cdist)" -i test
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
BUGS BUGS
@ -89,7 +130,8 @@ If it does, raise a bug.
SEE ALSO SEE ALSO
--------- ---------
- cconfig: http://www.nico.schottelius.org/docs/cconfig/ - cconfig homepage: http://www.nico.schottelius.org/docs/cconfig/
- ctt homepage: http://www.nico.schottelius.org/software/ctt/
COPYING COPYING