mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdHelp: Added extension list to the 'help' command
This commit is contained in:
parent
140ec98aaa
commit
64cf3fad76
4 changed files with 22 additions and 8 deletions
|
@ -41,6 +41,7 @@
|
||||||
(thanks to Martin Boeker).
|
(thanks to Martin Boeker).
|
||||||
- Added DOM support and a 'get' command.
|
- Added DOM support and a 'get' command.
|
||||||
- Added 'totals.py' sample extension.
|
- Added 'totals.py' sample extension.
|
||||||
|
- Added extension list to the 'help' command.
|
||||||
|
|
||||||
------ old release ---------------------------
|
------ old release ---------------------------
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
int CmdHelpUsage ()
|
int CmdHelpUsage (const Extensions& extensions)
|
||||||
{
|
{
|
||||||
// TODO This is going to need more formatting.
|
// TODO This is going to need more formatting.
|
||||||
// TODO Align the arg types?
|
// TODO Align the arg types?
|
||||||
|
@ -65,8 +65,19 @@ int CmdHelpUsage ()
|
||||||
<< " timew track <interval> [<tag> ...]\n"
|
<< " timew track <interval> [<tag> ...]\n"
|
||||||
<< " timew untag @<id> [@<id> ...] <tag> [<tag> ...]\n"
|
<< " timew untag @<id> [@<id> ...] <tag> [<tag> ...]\n"
|
||||||
<< " timew week [<interval>] [<tag> ...]\n"
|
<< " timew week [<interval>] [<tag> ...]\n"
|
||||||
<< '\n'
|
<< '\n';
|
||||||
<< "Additional help:\n"
|
|
||||||
|
if (extensions.all ().size ())
|
||||||
|
{
|
||||||
|
std::cout << "Extensions (extensions do not provide help):\n";
|
||||||
|
|
||||||
|
for (auto& ext : extensions.all ())
|
||||||
|
std::cout << " " << File (ext).name () << '\n';
|
||||||
|
|
||||||
|
std::cout << '\n';
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "Additional help:\n"
|
||||||
<< " timew help <command>\n"
|
<< " timew help <command>\n"
|
||||||
<< " timew help interval\n"
|
<< " timew help interval\n"
|
||||||
<< " timew help hints\n"
|
<< " timew help hints\n"
|
||||||
|
@ -104,7 +115,9 @@ int CmdHelpUsage ()
|
||||||
//
|
//
|
||||||
// Strict 80-character limit.
|
// Strict 80-character limit.
|
||||||
// Provide examples where appropriate - enough to cover all uses.
|
// Provide examples where appropriate - enough to cover all uses.
|
||||||
int CmdHelp (const CLI& cli)
|
int CmdHelp (
|
||||||
|
const CLI& cli,
|
||||||
|
const Extensions& extensions)
|
||||||
{
|
{
|
||||||
auto words = cli.getWords ();
|
auto words = cli.getWords ();
|
||||||
if (words.size ())
|
if (words.size ())
|
||||||
|
@ -906,7 +919,7 @@ int CmdHelp (const CLI& cli)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CmdHelpUsage ();
|
return CmdHelpUsage (extensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -43,8 +43,8 @@ int CmdExtensions ( Rules&, const Extensions&);
|
||||||
int CmdFill (const CLI&, Rules&, Database& );
|
int CmdFill (const CLI&, Rules&, Database& );
|
||||||
int CmdGaps (const CLI&, Rules&, Database& );
|
int CmdGaps (const CLI&, Rules&, Database& );
|
||||||
int CmdGet (const CLI&, Rules&, Database& );
|
int CmdGet (const CLI&, Rules&, Database& );
|
||||||
int CmdHelpUsage ( );
|
int CmdHelpUsage ( const Extensions&);
|
||||||
int CmdHelp (const CLI& );
|
int CmdHelp (const CLI&, const Extensions&);
|
||||||
int CmdJoin (const CLI&, Rules&, Database& );
|
int CmdJoin (const CLI&, Rules&, Database& );
|
||||||
int CmdLengthen (const CLI&, Rules&, Database& );
|
int CmdLengthen (const CLI&, Rules&, Database& );
|
||||||
int CmdMove (const CLI&, Rules&, Database& );
|
int CmdMove (const CLI&, Rules&, Database& );
|
||||||
|
|
|
@ -268,7 +268,7 @@ int dispatchCommand (
|
||||||
*/
|
*/
|
||||||
else if (command == "gaps") status = CmdGaps (cli, rules, database );
|
else if (command == "gaps") status = CmdGaps (cli, rules, database );
|
||||||
else if (command == "get") status = CmdGet (cli, rules, database );
|
else if (command == "get") status = CmdGet (cli, rules, database );
|
||||||
else if (command == "help") status = CmdHelp (cli );
|
else if (command == "help") status = CmdHelp (cli, extensions);
|
||||||
else if (command == "join") status = CmdJoin (cli, rules, database );
|
else if (command == "join") status = CmdJoin (cli, rules, database );
|
||||||
else if (command == "lengthen") status = CmdLengthen (cli, rules, database );
|
else if (command == "lengthen") status = CmdLengthen (cli, rules, database );
|
||||||
else if (command == "month") status = CmdChartMonth (cli, rules, database );
|
else if (command == "month") status = CmdChartMonth (cli, rules, database );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue