From 97720e4061a7e7072b263f1f102fa4c383b5b115 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 19 Mar 2016 12:30:44 -0400 Subject: [PATCH] CmdHelp: Added help for the log command --- src/commands/CmdHelp.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/commands/CmdHelp.cpp b/src/commands/CmdHelp.cpp index eb0b4e43..4cb540f0 100644 --- a/src/commands/CmdHelp.cpp +++ b/src/commands/CmdHelp.cpp @@ -45,11 +45,35 @@ int CmdHelpUsage () } //////////////////////////////////////////////////////////////////////////////// +// TODO Perhaps have a set of 'documents' to display, and a keyword index that +// maps to the the appropriate ones. Then display a list of any ambiguous +// requests, or the appropriate doc for single hits. Perhaps a 'See also'. +// // Strict 80-character limit. int CmdHelp (const std::vector & args, Log& log) { - std::cout << "# help\n"; - return 0; + if (args.size () > 2) + { + // Ruler 1 2 3 4 5 6 7 8 + // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 + if (args[2] == "log") + std::cout << "\n" + << "timew log []\n" + << "\n" + << "Writes the info to the Timewarrior log file. The may be\n" + << "multiple words, or a quoted string. If is ommitted, writes a cut\n" + << "marker ('-------- 8< --------') line to the log file.\n" + << "\n" + << "Note: Your log file is found here:\n" + << " " << log.file () << "\n" + << "\n"; + else + std::cout << "No help available for '" << args[2] << "'\n"; + + return 0; + } + + return CmdHelpUsage (); } ////////////////////////////////////////////////////////////////////////////////