mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdShorten: Added 'shorten' command
This commit is contained in:
parent
9bffcb547d
commit
30ffaf4c01
5 changed files with 50 additions and 0 deletions
|
@ -23,6 +23,9 @@
|
||||||
- Added 'track' command.
|
- Added 'track' command.
|
||||||
- Added 'cancel' command.
|
- Added 'cancel' command.
|
||||||
- Added 'config' command.
|
- Added 'config' command.
|
||||||
|
- Added 'tag' command.
|
||||||
|
- Added 'untag' command.
|
||||||
|
- Added 'shorten' command.
|
||||||
|
|
||||||
Design completed 2016-03-13
|
Design completed 2016-03-13
|
||||||
Project started 2015-11-29
|
Project started 2015-11-29
|
||||||
|
|
|
@ -21,6 +21,7 @@ set (commands_SRCS CmdCancel.cpp
|
||||||
CmdStart.cpp
|
CmdStart.cpp
|
||||||
CmdStop.cpp
|
CmdStop.cpp
|
||||||
CmdSummary.cpp
|
CmdSummary.cpp
|
||||||
|
CmdShorten.cpp
|
||||||
CmdShow.cpp
|
CmdShow.cpp
|
||||||
CmdTag.cpp
|
CmdTag.cpp
|
||||||
CmdTags.cpp
|
CmdTags.cpp
|
||||||
|
|
43
src/commands/CmdShorten.cpp
Normal file
43
src/commands/CmdShorten.cpp
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Copyright 2015 - 2016, 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
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included
|
||||||
|
// in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
//
|
||||||
|
// http://www.opensource.org/licenses/mit-license.php
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <cmake.h>
|
||||||
|
#include <commands.h>
|
||||||
|
#include <timew.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
int CmdShorten (
|
||||||
|
const CLI& cli,
|
||||||
|
Rules& rules,
|
||||||
|
Database& database)
|
||||||
|
{
|
||||||
|
std::cout << "# CmdShorten\n";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
|
@ -45,6 +45,7 @@ int CmdHelpUsage ( );
|
||||||
int CmdHelp (const CLI& );
|
int CmdHelp (const CLI& );
|
||||||
int CmdImport ( );
|
int CmdImport ( );
|
||||||
int CmdReport (const CLI&, Rules&, Database&, const Extensions&);
|
int CmdReport (const CLI&, Rules&, Database&, const Extensions&);
|
||||||
|
int CmdShorten (const CLI&, Rules&, Database& );
|
||||||
int CmdShow ( Rules& );
|
int CmdShow ( Rules& );
|
||||||
int CmdStart (const CLI&, Rules&, Database& );
|
int CmdStart (const CLI&, Rules&, Database& );
|
||||||
int CmdStop (const CLI&, Rules&, Database& );
|
int CmdStop (const CLI&, Rules&, Database& );
|
||||||
|
|
|
@ -68,6 +68,7 @@ void initializeEntities (CLI& cli)
|
||||||
cli.entity ("command", "help");
|
cli.entity ("command", "help");
|
||||||
cli.entity ("command", "import");
|
cli.entity ("command", "import");
|
||||||
cli.entity ("command", "report");
|
cli.entity ("command", "report");
|
||||||
|
cli.entity ("command", "shorten");
|
||||||
cli.entity ("command", "show");
|
cli.entity ("command", "show");
|
||||||
cli.entity ("command", "start");
|
cli.entity ("command", "start");
|
||||||
cli.entity ("command", "stop");
|
cli.entity ("command", "stop");
|
||||||
|
@ -255,6 +256,7 @@ int dispatchCommand (
|
||||||
else if (command == "import") status = CmdImport ( );
|
else if (command == "import") status = CmdImport ( );
|
||||||
else if (command == "month") status = CmdChartMonth (cli, rules, database );
|
else if (command == "month") status = CmdChartMonth (cli, rules, database );
|
||||||
else if (command == "report") status = CmdReport (cli, rules, database, extensions);
|
else if (command == "report") status = CmdReport (cli, rules, database, extensions);
|
||||||
|
else if (command == "shorten") status = CmdShorten (cli, rules, database );
|
||||||
else if (command == "show") status = CmdShow ( rules );
|
else if (command == "show") status = CmdShow ( rules );
|
||||||
else if (command == "start") status = CmdStart (cli, rules, database );
|
else if (command == "start") status = CmdStart (cli, rules, database );
|
||||||
else if (command == "stop") status = CmdStop (cli, rules, database );
|
else if (command == "stop") status = CmdStop (cli, rules, database );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue