From 64fd98a2bdd18cf78650cd6cabdac651d37a8a13 Mon Sep 17 00:00:00 2001 From: Thomas Lauf Date: Thu, 27 Sep 2018 22:02:15 +0200 Subject: [PATCH] Add help and man page for command 'undo' --- doc/man/timew-undo.1.in | 15 +++++++++++++++ src/commands/CmdHelp.cpp | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 doc/man/timew-undo.1.in diff --git a/doc/man/timew-undo.1.in b/doc/man/timew-undo.1.in new file mode 100644 index 00000000..72798520 --- /dev/null +++ b/doc/man/timew-undo.1.in @@ -0,0 +1,15 @@ +.TH timew-undo 1 2018-02-03 "${PACKAGE_STRING}" "User Manuals" +. +.SH NAME +timew-undo \- revert Timewarrior commands +. +.SH SYNOPSIS +.B timew undo +. +.SH DESCRIPTION +The 'undo' command is used to revert the action of Timewarrior commands. +Only commands affecting intervals or Timewarrior configuration can be reverted. +Timewarrior keeps a journal of changes to the interval database and Timewarrior configuration. +A call to 'undo' removes the last entry in the journal and restores the previous state. +As long as there are entries in the journal, you can revert the respective action. +The 'undo' command itself cannot be undone! \ No newline at end of file diff --git a/src/commands/CmdHelp.cpp b/src/commands/CmdHelp.cpp index fcf159a2..9c30e02b 100644 --- a/src/commands/CmdHelp.cpp +++ b/src/commands/CmdHelp.cpp @@ -63,6 +63,7 @@ int CmdHelpUsage (const Extensions& extensions) << " timew tag @ [@ ...] [ ...]\n" << " timew tags [] [ ...]\n" << " timew track [ ...]\n" + << " timew undo\n" << " timew untag @ [@ ...] [ ...]\n" << " timew week [] [ ...]\n" << '\n'; @@ -900,6 +901,21 @@ int CmdHelp ( << "same as the 'start' command.\n" << '\n'; + // Ruler 1 2 3 4 5 6 7 8 + // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 + else if (words[0] == "undo") + { + std::cout << '\n' + << "Syntax: timew undo\n" + << '\n' + << "The 'undo' command is used to revert the action of Timewarrior commands. Only\n" + << "commands affecting intervals or Timewarrior configuration can be reverted.\n" + << "Timewarrior keeps a journal of changes to the interval database and Timewarrior\n" + << "configuration. A call to 'undo' removes the last entry in the journal and\n" + << "restores the previous state. As long as there are entries in the journal, you\n" + << "can revert the respective action. The 'undo' command itself cannot be undone!" + << '\n'; + } // Ruler 1 2 3 4 5 6 7 8 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 else if (words[0] == "untag")