mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
- Added color command.
This commit is contained in:
parent
148088c775
commit
4825b37df5
6 changed files with 97 additions and 5 deletions
|
@ -1,17 +1,18 @@
|
|||
|
||||
1.0.0 - First official release ()
|
||||
1.0.0 (?)
|
||||
- Bug: assertion fails on mobile for t v
|
||||
|
||||
0.9.9
|
||||
0.9.9 (?)
|
||||
- Documentation complete
|
||||
|
||||
0.9.8
|
||||
0.9.8 (?)
|
||||
- Autoconf/autmake behaving properly.
|
||||
- All bugs fixed
|
||||
+ Color command
|
||||
|
||||
------ reality -----------------------------------
|
||||
|
||||
0.9.7 (5/19/2008)
|
||||
0.9.7 (5/24/2008)
|
||||
+ Migrated old compiler flags into Makefile.am
|
||||
+ Added ncurses endwin function check to configure.ac
|
||||
+ Set up structure for AUTHORS file.
|
||||
|
|
7
TUTORIAL
7
TUTORIAL
|
@ -487,6 +487,13 @@ with no arguments will generate a help message that lists all these commands.
|
|||
|
||||
|
||||
|
||||
% task colors
|
||||
-------------
|
||||
|
||||
This command displays all the colors that task supports.
|
||||
|
||||
|
||||
|
||||
% task usage
|
||||
------------
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_INIT(task, 0.9.7, bugs@beckingham.net)
|
||||
AC_INIT(task, 0.9.8, bugs@beckingham.net)
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_SRCDIR([src/task.cpp])
|
||||
AC_CONFIG_HEADER([auto.h])
|
||||
|
|
|
@ -93,6 +93,7 @@ static char* commands[] =
|
|||
"active",
|
||||
"add",
|
||||
"calendar",
|
||||
"colors",
|
||||
"completed",
|
||||
"delete",
|
||||
"done",
|
||||
|
|
82
src/task.cpp
82
src/task.cpp
|
@ -143,6 +143,10 @@ void usage (Config& conf)
|
|||
table.addCell (row, 1, "task export");
|
||||
table.addCell (row, 2, "Exports all tasks as a CSV file");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task color");
|
||||
table.addCell (row, 2, "Displays all possible colors");
|
||||
|
||||
row = table.addRow ();
|
||||
table.addCell (row, 1, "task version");
|
||||
table.addCell (row, 2, "Shows the task version number");
|
||||
|
@ -220,6 +224,7 @@ int main (int argc, char** argv)
|
|||
else if (command == "info") handleInfo (tdb, task, conf);
|
||||
else if (command == "long") handleLongList (tdb, task, conf);
|
||||
else if (command == "ls") handleSmallList (tdb, task, conf);
|
||||
else if (command == "colors") handleColor ( conf);
|
||||
else if (command == "completed") handleCompleted (tdb, task, conf);
|
||||
else if (command == "delete") handleDelete (tdb, task, conf);
|
||||
else if (command == "start") handleStart (tdb, task, conf);
|
||||
|
@ -2477,6 +2482,83 @@ void handleModify (const TDB& tdb, T& task, Config& conf)
|
|||
throw std::string ("Task not found.");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void handleColor (Config& conf)
|
||||
{
|
||||
std::cout << std::endl << "Foreground" << std::endl
|
||||
<< " "
|
||||
<< Text::colorize (Text::bold, Text::nocolor, "bold") << " "
|
||||
<< Text::colorize (Text::underline, Text::nocolor, "underline") << " "
|
||||
<< Text::colorize (Text::bold_underline, Text::nocolor, "bold_underline") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::black, Text::nocolor, "black") << " "
|
||||
<< Text::colorize (Text::bold_black, Text::nocolor, "bold_black") << " "
|
||||
<< Text::colorize (Text::underline_black, Text::nocolor, "underline_black") << " "
|
||||
<< Text::colorize (Text::bold_underline_black, Text::nocolor, "bold_underline_black") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::red, Text::nocolor, "red") << " "
|
||||
<< Text::colorize (Text::bold_red, Text::nocolor, "bold_red") << " "
|
||||
<< Text::colorize (Text::underline_red, Text::nocolor, "underline_red") << " "
|
||||
<< Text::colorize (Text::bold_underline_red, Text::nocolor, "bold_underline_red") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::green, Text::nocolor, "green") << " "
|
||||
<< Text::colorize (Text::bold_green, Text::nocolor, "bold_green") << " "
|
||||
<< Text::colorize (Text::underline_green, Text::nocolor, "underline_green") << " "
|
||||
<< Text::colorize (Text::bold_underline_green, Text::nocolor, "bold_underline_green") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::yellow, Text::nocolor, "yellow") << " "
|
||||
<< Text::colorize (Text::bold_yellow, Text::nocolor, "bold_yellow") << " "
|
||||
<< Text::colorize (Text::underline_yellow, Text::nocolor, "underline_yellow") << " "
|
||||
<< Text::colorize (Text::bold_underline_yellow, Text::nocolor, "bold_underline_yellow") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::blue, Text::nocolor, "blue") << " "
|
||||
<< Text::colorize (Text::bold_blue, Text::nocolor, "bold_blue") << " "
|
||||
<< Text::colorize (Text::underline_blue, Text::nocolor, "underline_blue") << " "
|
||||
<< Text::colorize (Text::bold_underline_blue, Text::nocolor, "bold_underline_blue") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::magenta, Text::nocolor, "magenta") << " "
|
||||
<< Text::colorize (Text::bold_magenta, Text::nocolor, "bold_magenta") << " "
|
||||
<< Text::colorize (Text::underline_magenta, Text::nocolor, "underline_magenta") << " "
|
||||
<< Text::colorize (Text::bold_underline_magenta, Text::nocolor, "bold_underline_magenta") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::cyan, Text::nocolor, "cyan") << " "
|
||||
<< Text::colorize (Text::bold_cyan, Text::nocolor, "bold_cyan") << " "
|
||||
<< Text::colorize (Text::underline_cyan, Text::nocolor, "underline_cyan") << " "
|
||||
<< Text::colorize (Text::bold_underline_cyan, Text::nocolor, "bold_underline_cyan") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::white, Text::nocolor, "white") << " "
|
||||
<< Text::colorize (Text::bold_white, Text::nocolor, "bold_white") << " "
|
||||
<< Text::colorize (Text::underline_white, Text::nocolor, "underline_white") << " "
|
||||
<< Text::colorize (Text::bold_underline_white, Text::nocolor, "bold_underline_white") << std::endl
|
||||
|
||||
<< std::endl << "Background" << std::endl
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_black, "on_black") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_black, "on_bright_black") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_red, "on_red") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_red, "on_bright_red") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_green, "on_green") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_green, "on_bright_green") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_yellow, "on_yellow") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_yellow, "on_bright_yellow") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_blue, "on_blue") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_blue, "on_bright_blue") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_magenta, "on_magenta") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_magenta, "on_bright_magenta") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_cyan, "on_cyan") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_cyan, "on_bright_cyan") << std::endl
|
||||
|
||||
<< " " << Text::colorize (Text::nocolor, Text::on_white, "on_white") << " "
|
||||
<< Text::colorize (Text::nocolor, Text::on_bright_white, "on_bright_white") << std::endl
|
||||
|
||||
<< std::endl;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void gatherNextTasks (
|
||||
const TDB& tdb,
|
||||
|
|
|
@ -47,6 +47,7 @@ void handleDelete (const TDB&, T&, Config&);
|
|||
void handleStart (const TDB&, T&, Config&);
|
||||
void handleDone (const TDB&, T&, Config&);
|
||||
void handleModify (const TDB&, T&, Config&);
|
||||
void handleColor (Config&);
|
||||
void gatherNextTasks (const TDB&, T&, Config&, std::vector <T>&, std::vector <int>&);
|
||||
void nag (const TDB&, T&, Config&);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue