/todo

To get this branch, use:
bzr branch http://bzr.ed.am/todo

« back to all changes in this revision

Viewing changes to todo

  • Committer: edam
  • Date: 2012-08-01 19:54:49 UTC
  • Revision ID: tim@ed.am-20120801195449-fcyrejq9aazxa5l5
detect extra arguments and extend --help message

Show diffs side-by-side

added added

removed removed

30
30
    's|section=s' => \$display_section,
31
31
    'help' => \$mode_help,
32
32
    'version' => \$mode_version,
33
 
) ) {
 
33
) || @ARGV > 0 ) {
34
34
    print "Try `$app_name --help' for more information.\n";
35
35
    exit( 1 );
36
36
}
38
38
# help mode
39
39
if( $mode_help ) {
40
40
    print "todo - display your todo file\n\n".
 
41
        #01234567890123456789012345678901234567890123456789012345678901234567890123456789
41
42
    "Usage: $app_name [OPTIONS]\n\n".
42
43
    "Options:\n".
43
44
    "  -a, --all              display all sections\n".
44
45
    "  -e, --edit             edit your todo file\n".
45
46
    "  -h, --headers          show setion headers\n".
46
47
        "  -l, --list             show the list in your pager (see notes)\n".
47
 
    "  -s, --section=SECTION  display this named section\n".
 
48
    "  -s, --section=SECTION  display sections matching the regular expression\n".
48
49
    "      --help     display this help and exit\n".
49
50
    "      --version  output version information and exit\n".
50
51
        "\n".
 
52
        "Running without any options is the same as running with --section=TODO and\n".
 
53
        "lists the default section of the todo file.\n".
 
54
        "\n".
51
55
        "The advantage of using '--list' is that the pager is run as if the\n".
52
56
        "todo list were being edited. This means that if you decide to spawn an\n".
53
57
        "editor from you pager and edit the list, these changes get noticed.\n".