diff --git a/src/commands/CmdHelp.cpp b/src/commands/CmdHelp.cpp index 78a77960..da67249e 100644 --- a/src/commands/CmdHelp.cpp +++ b/src/commands/CmdHelp.cpp @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // -// Copyright 2016 - 2018, Paul Beckingham, Federico Hernandez. +// Copyright 2016 - 2019, Thomas Lauf, Paul Beckingham, Federico Hernandez. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -27,12 +27,11 @@ #include #include #include +#include //////////////////////////////////////////////////////////////////////////////// int CmdHelpUsage (const Extensions& extensions) { - // TODO This is going to need more formatting. - // TODO Align the arg types? std::cout << '\n' << "Usage: timew [--version]\n" << " timew annotate @ [@ ...] \n" @@ -44,9 +43,6 @@ int CmdHelpUsage (const Extensions& extensions) << " timew diagnostics\n" << " timew export [] [ ...]\n" << " timew extensions\n" -/* - << " timew fill @ [@ ...]\n" -*/ << " timew gaps [] [ ...]\n" << " timew get [ ...]\n" << " timew help [ | interval | hints | date | duration]\n" @@ -106,18 +102,9 @@ int CmdHelpUsage (const Extensions& extensions) << " rc.=\n" << '\n'; - // TODO List all extensions. - return 0; } -//////////////////////////////////////////////////////////////////////////////// -// TODO Should the CmdXxx functions themselves be responsible for providing both -// the command syntax and the help text? -// A: Only if they are upgraded to objects. -// -// Strict 80-character limit. -// Provide examples where appropriate - enough to cover all uses. int CmdHelp ( const CLI& cli, const Extensions& extensions) @@ -126,893 +113,8 @@ int CmdHelp ( if (! words.empty ()) { - // Ruler 1 2 3 4 5 6 7 8 - // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 - if (words[0] == "annotate") - std::cout << '\n' - << "Syntax: timew annotate @ [@ ...] \n" - << '\n' - << "The 'annotate' command is used to add an annotation to an interval. Using the 'summary'\n" - << "command, and specifying the ':ids' hint shows interval IDs. Using the right ID,\n" - << "you can identify an interval to annotate. For example, show the IDs:\n" - << '\n' - << " $ timew summary :week :ids\n" - << '\n' - << "Then having selected '@2' as the interval you wish to annotate:\n" - << '\n' - << " $ timew annotate @2 'lorem ipsum'\n" - << '\n' - << "Note that you can annotate multiple intervals with the same annotation:\n" - << '\n' - << " $ timew annotate @2 @10 @23 'lorem ipsum dolor sit amet...'\n" - << '\n' - << "See also 'tag'.\n" - << '\n'; - - // Ruler 1 2 3 4 5 6 7 8 - // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 - else if (words[0] == "cancel") - std::cout << '\n' - << "Syntax: timew cancel\n" - << '\n' - << "If there is an open interval, it is abandoned.\n" - << '\n' - << "See also 'start', 'stop', 'delete'.\n" - << '\n'; - - // Ruler 1 2 3 4 5 6 7 8 - // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 - else if (words[0] == "config") - std::cout << '\n' - << "Syntax: timew config [ [ | '']]\n" - << '\n' - << "Allows setting and removing configuration values, as an alternative to directly\n" - << "editing your ~/.timewarrior/timewarrior.cfg file. For example:\n" - << '\n' - << " $ timew config verbose yes\n" - << " $ timew config verbose ''\n" - << " $ timew config verbose\n" - << '\n' - << "The first command sets 'verbose' to 'yes'. The second sets it to a blank value\n" - << "which overrides the default value. The third example deletes the 'verbose'\n" - << "setting.\n" - << '\n' - << "When modifying configuration in this way, interactive confirmation will be\n" - << "sought. To override this confirmation, use the ':yes' hint, which means you\n" - << "intend to answer 'yes' to the confirmation questions:\n" - << '\n' - << " $ timew config verbose '' :yes\n" - << '\n' - << "If no arguments are provided, all configuration settings are shown:\n" - << '\n' - << " $ timew config\n" - << " verbose = yes\n" - << " ...\n" - << '\n' - << "See also 'hints', 'show'.\n" - << '\n'; - - // Ruler 1 2 3 4 5 6 7 8 - // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 - else if (words[0] == "continue") - std::cout << '\n' - << "Syntax: timew continue [] [|]\n" - << '\n' - << "Resumes tracking of a closed interval. For example:\n" - << '\n' - << " $ timew track 9am - 10am tag1 tag2\n" - << " $ timew continue\n" - << '\n' - << "This continues the most recent interval. One can refer to another closed\n" - << "interval by referencing its id:\n" - << '\n' - << " $ timew track 9am - 10am tag1 tag2\n" - << " $ timew track 11am - 1pm tag3\n" - << " $ timew continue @2\n" - << '\n' - << "The 'continue' command creates a new interval, starting now, and using the tags\n" - << "'tag1' and 'tag2'. (Using the 'summary' command and specifying the ':ids' hint\n" - << "shows interval IDs.) Independently from an ID, one can specify a new start time\n" - << "or an interval range:\n" - << '\n' - << " $ timew continue @2 4min ago\n" - << '\n' - << "This continues the interval referenced by ID 2 with a new start time (4 minutes\n" - << "before now)\n" - << '\n' - << " $ timew continue 18pm - 19pm\n" - << '\n' - << "This adds a copy of the latest interval with a new interval range.\n" - << '\n' - << "'continue' is a convenient way to resume work without re-entering the tags.\n" - << '\n' - << "See also 'start', 'stop'.\n" - << '\n'; - - // Ruler 1 2 3 4 5 6 7 8 - // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 - else if (words[0] == "date") - std::cout << '\n' - << "Timewarrior supports the following date formats based on ISO-8601:\n" - << '\n' - << " [T ] Extended date, optional extended time\n" - << " [T