diff --git a/.gitignore b/.gitignore index a2d1518d9..60c9df39e 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,5 @@ install_manifest.txt _CPack_Packages CPackConfig.cmake CPackSourceConfig.cmake +patches +*.exe diff --git a/AUTHORS b/AUTHORS index f0a874e6b..0e91237ea 100644 --- a/AUTHORS +++ b/AUTHORS @@ -86,6 +86,15 @@ The following submitted code, packages or analysis, and deserve special thanks: Russell Steicke YBSAR Ben Armstrong + Tullio Facchinetti + Thomas Sullivan + Martin Natano + kili + jasper + Aaron Bieber + John West + Jeroen Budts + Zed Jorarard Thanks to the following, who submitted detailed bug reports and excellent suggestions: @@ -176,3 +185,10 @@ suggestions: alparo Roy Zuo Friedrich Heusler + Ben Armstrong + XTaran + John West + Dmitriy Matrosov + Michele Santullo + Scott Kroll + Kosta H diff --git a/CMakeLists.txt b/CMakeLists.txt index b9a3d5623..0a3915717 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,17 @@ else (${CMAKE_SYSTEM_NAME} MATCHES "Linux") set (UNKNOWN true) endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux") +if (FREEBSD) +SET (TASK_MAN1DIR man/man1 CACHE STRING "Installation directory for man pages, section 1") +SET (TASK_MAN5DIR man/man5 CACHE STRING "Installation directory for man pages, section 5") +else (FREEBSD) +SET (TASK_MAN1DIR share/man/man1 CACHE STRING "Installation directory for man pages, section 1") +SET (TASK_MAN5DIR share/man/man5 CACHE STRING "Installation directory for man pages, section 5") +endif (FREEBSD) +SET (TASK_DOCDIR share/doc/task CACHE STRING "Installation directory for doc files") +SET (TASK_RCDIR "${TASK_DOCDIR}/rc" CACHE STRING "Installation directory for configuration files") +SET (TASK_BINDIR bin CACHE STRING "Installation directory for the binary") + message ("-- Looking for SHA1 references") if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index) set (HAVE_COMMIT true) @@ -83,8 +94,6 @@ if (READLINE_FOUND) set (TASK_LIBRARIES ${TASK_LIBRARIES} ${READLINE_LIBRARIES}) endif (READLINE_FOUND) -check_function_exists (random HAVE_RANDOM) -check_function_exists (srandom HAVE_SRANDOM) check_function_exists (timegm HAVE_TIMEGM) check_function_exists (get_current_dir_name HAVE_GET_CURRENT_DIR_NAME) @@ -92,31 +101,29 @@ check_struct_has_member ("struct tm" tm_gmtoff time.h HAVE_TM_GMTOFF) check_struct_has_member ("struct stat" st_birthtime "sys/types.h;sys/stat.h" HAVE_ST_BIRTHTIME) message ("-- Looking for libuuid") -if (DARWIN) - # Apple includes the uuid functions in their libc, rather than libuuid - set (HAVE_UUID true) +if (DARWIN OR FREEBSD) + # Apple and FreeBSD include the uuid functions in their libc, rather than libuuid check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER) -else (DARWIN) +else (DARWIN OR FREEBSD) find_path (UUID_INCLUDE_DIR uuid/uuid.h) find_library (UUID_LIBRARY NAMES uuid) if (UUID_INCLUDE_DIR AND UUID_LIBRARY) - set (HAVE_UUID true) set (TASK_INCLUDE_DIRS ${TASK_INCLUDE_DIRS} ${UUID_INCLUDE_DIR}) set (TASK_LIBRARIES ${TASK_LIBRARIES} ${UUID_LIBRARY}) # Look for uuid_unparse_lower set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${UUID_INCLUDE_DIR}) set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${UUID_LIBRARY}) check_function_exists (uuid_unparse_lower HAVE_UUID_UNPARSE_LOWER) + else (UUID_INCLUDE_DIR AND UUID_LIBRARY) + message (FATAL_ERROR "-- libuuid not found.") endif (UUID_INCLUDE_DIR AND UUID_LIBRARY) -endif (DARWIN) +endif (DARWIN OR FREEBSD) -if (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER) +if (HAVE_UUID_UNPARSE_LOWER) message ("-- Found libuuid") -elseif (HAVE_UUID AND NOT HAVE_UUID_UNPARSE_LOWER) +else (HAVE_UUID_UNPARSE_LOWER) message ("-- Found libuuid, using internal uuid_unparse_lower") -else (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER) - message ("-- libuuid not found, using internal uuid") -endif (HAVE_UUID AND HAVE_UUID_UNPARSE_LOWER) +endif (HAVE_UUID_UNPARSE_LOWER) # Set the package language. if (LANGUAGE) @@ -129,6 +136,7 @@ set (LANGUAGE_EN_US 1) set (LANGUAGE_ES_ES 2) set (LANGUAGE_DE_DE 3) set (LANGUAGE_FR_FR 4) +set (LANGUAGE_IT_IT 5) message ("-- Configuring cmake.h") configure_file ( @@ -162,5 +170,5 @@ set (CPACK_SOURCE_IGNORE_FILES "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSo "_CPack_Packages" "cmake_install" "install_manifest" "Makefile$" "test" "package-config" "misc/*" "src/task$" "src/libtask.a" "src/columns/libcolumns.a" "src/commands/libcommands.a" - "src/shell/tasksh$" "auto.h$" "/\\.gitignore""/\\.git/" "swp$") + "src/shell/tasksh$" "auto.h$" "/\\.gitignore" "/\\.git/" "swp$") include (CPack) diff --git a/COPYING b/COPYING index fa467597a..a48fa5537 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ taskwarrior - a command line task list manager. -Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +Copyright 2006-2014, 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 diff --git a/ChangeLog b/ChangeLog index 5142a1bbc..992f11160 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,20 +17,57 @@ Bugs Features + #328 Replaced the 'shell' command with a standalone 'tasksh' binary, which includes GNU readline support (thanks to Haitham Gad). - + #934 support for 'reserved.lines' to accomodate multi-line + + #934 support for 'reserved.lines' to accommodate multi-line shell prompts when used in conjunction with 'limit:page' (thanks to Robert Gill). - + #1227 A new 'verify_l10n' utility ensures the localizations are in sync (thanks to - Wim Schuermann). + + #1226 A new French translation has begun, and will continue to be a work in + progress for a while (thanks to YBSA R). + + #1227 A new 'verify_l10n' utility ensures the localizations are in sync + (thanks to Wim Schuermann). + #1250 Support out-of-tree test runs (thanks to Jakub Wilk). + + #1256 Supports default values for UDA fields (thanks to Thomas Sullivan). + + #1297 The task₋sync(5) man pages is rewritten with examples. + + #1339 The configuration file now supports JSON encoding of Unicode + characters, by specifying \uNNNN. + + #1385 Need a way to configure the trust of self-signed certificates. + + #1423 sync vs. push, pull, merge collision avoidance. + + #1473 Make TASK_RCDIR customizable (thanks to Jakub Wilk). + Stores un-synched transactions in /backlog.data. - + Adds a new 'synchronize' command to sync data with a task server. - + Adds a new 'sync' verbosity token, which will reminds when a backlog builds + + Adds a new 'synchronize' command to sync data with a Taskserver. + + Adds a new 'initialize' synchronize command argument that uploads all pending + tasks for first-time initialization. + + Adds a new 'sync' verbosity token, which will remind when a backlog builds up and needs a sync. + Supports IPv4 and IPv6 server addresses. + Began fr-FR localization. + + Complete it-IT localization. + + Merged three l10n utility scripts into one tools, scripts/utils/l10n, which + will help the translation effort. + + The 'due' urgency component now uses seconds, not days, in the calculation. + + The 'debug.tls' configuration variable takes an integer which corresponds to + the GnuTLS log level. For debugging. + + File format 2 (used in version 0.9.3 - 1.5.0) is no longer supported. + + Migrated column processing code into Task.cpp for future use within each + individual column object. Legacy code left in Task.cpp for column objects + that are not yet modified. + + ColPriority.cpp - Migration of column modification code out of Task.cpp and + into the individual column object. + + Now requires libuuid (thanks to Martin Natano). + + New '_get' is a DOM accessor helper command. + + New virtual tags (WEEK, MONTH, YEAR, PARENT). + + Added the 'remaining' format for all date columns. + + Protects against interrupt during critical DB commit and sync operations. + + The 'push', 'pull' and 'merge' commands now generate a 'deprecated' message. + + Rewritten task-sync(5) man page, listing sync options and setup guidelines.. + + Now properly uses the libc version of uuid_create and uuid_to_string for + FreeBSD (thanks to Pietro Cerutti). + + Performance improvements: + + Optimizes indexing into pending.data for direct task access. + + Improved I/O performance with better defaults for buffer sizes. Bugs + + #1195 Random seed not random enough - removed all random number code (thanks + to Jakub Wilk). + #1196 Now builds on Hurd (thanks to Jakub Wilk). + #1197 Now 'tasksh' recognizes Ctrl-D to exit. + #1200 Directory d_type==DT_UNKNOWN is now handled correctly (thanks to Jakub @@ -39,9 +76,41 @@ Bugs 'Y-M-D' (thanks to Robin Björklin). + #1222 The 'summary' report now obeys the 'color.label' setting (thanks to Steve Rader). + + #1235 The 'shell' command can now start in non-interactive mode without a + .taskrc file (thanks to Haitham Gad). + #1247 Tests now create a local dir, rather than use the insecure /tmp dir (thanks to Jakub Wilk). + + #1248 Merge tests no longer connect to takwarrior.org (thank to Jakub Wilk). + + #1249 Build system now recognizes GNU/Hurd and GNU/kFreeBSD (thanks to Jakub + Wilk). + + #1263 The 'waiting' report properly lists only pending tasks with a wait date + (thanks to Fidel Mato). + + #1268 Edit doesn't accept changes, if task has completed dependency (thanks + to Dmitriy Matrosov, Michele Santullo). + + #1270 The 'undo' command is now properly removing backlog entries. + + #1273 Query with negative relative date differs greatly from absolute date + in past (thanks to John West). + + #1279 Assorted corrections to the task-ref.pdf document (thanks to Benjamin + Weber). + + #1286 Cannot use "sow", "som", etc in "entry.after", "end.after" filters + (thanks to Jake Bell). + + #1300 Encode/decode pairing is now properly balanced. + + #1305 Commit hash now available in tarball builds (thanks to Ben Boeckel). + + #1352 Terminal crashes when using taskwarrior's zsh completion (thanks to + Ivan Freitas, XTaran). + + #1356 Command reference now mentions /from/to/g. + + #1381 Invalid JSON exported by Task 2.3.0-beta1 (thanks to Kosta H). + + #1387 ZSH Auto-Completion dates are not current (thanks to Benjamin Weber). + + #1388 Updated task(1) man pages with import/export script examples (thanks to + Benjamin Weber). + + #1410 Incomplete Date Synonym List in man task (thanks to Benjamin Weber). + + #1414 Client does not verify SSL certificates (thanks to Scott Kroll). + + #1415 Client should not require a SSL certificate if the server has a trusted + certificate (thanks to Scott Kroll). + Fixed bug so that 'limit:page' now considers footnote messages. + + Fixed bug where specifying an ID of 0 yielded all completed/deleted tasks + (thanks to greenskeleton). + + Fixed rc.nag documentation (thanks to Jeroen Budts). ------ old releases ------------------------------ @@ -74,7 +143,7 @@ Features + Removed deprecated 'fg:' and 'bg:' attributes. + The 'diagnostics' command now reports libuuid details. + New characters for parsing and formating dates ('n', 's' and 'v'). - + Virtual tags (BLOCKED, UNBLOCKED, BLOCKING, DUE, DUETODAY, TODAY, OVERDUE, + + Virtual tags (BLOCKED, UNBLOCKED, BLOCKING, DUE, DUETODAY, OVERDUE, TODAY, ACTIVE, SCHEDULED, CHILD, UNTIL, WAITING and ANNOTATED). + New 'modified' attribute, which contains the most recent modification date, if a modification has occurred. diff --git a/DEVELOPER b/DEVELOPER index 763e2f8cf..fa7d7d87e 100644 --- a/DEVELOPER +++ b/DEVELOPER @@ -125,6 +125,7 @@ Unit Tests Needed code and run the test suite: git clone git://tasktools.org:task.git cd task.git + git checkout 2.3.0 cmake . make make test @@ -187,7 +188,10 @@ Current Codebase Condition '2.3.0' branch: - Current development branch with sync features, and new tasksh. + '2.4.0' branch: + - Command line parser rewrite. + --- 2012-05-12 Added general statement about how to contribute. -2013-03-31 Updated branch info. +2013-09-09 Updated branch info. diff --git a/EXPOSITION b/EXPOSITION index c1f2d790f..bf3e8f903 100644 --- a/EXPOSITION +++ b/EXPOSITION @@ -90,7 +90,7 @@ Files 'merge' command. The backlog.data file contains an accumulated set of changes that have not - been transmitted to the task server. It grows unbounded between 'synch' + been transmitted to the Taskserver. It grows unbounded between 'synch' commands. @@ -156,7 +156,7 @@ Test Suite many platforms. Code changes are automatically detected, propagated, built and tested on a variety of participating platforms. Grid testing results are here: - http://tasktools.org/tinderbox/taskwarrior.html + http://tasktools.org/tinderbox/taskwarrior-2.3.0.html When making code changes, it is important that the test suite be run to verify that functionality was not broken. diff --git a/INSTALL b/INSTALL index 98bacd59a..7cb906de9 100644 --- a/INSTALL +++ b/INSTALL @@ -67,6 +67,7 @@ lists them and their defaults plus the CMAKE_INSTALL_PREFIX: CMAKE_INSTALL_PREFIX /usr/local TASK_BINDIR bin TASK_DOCDIR share/doc/task + TASK_RCDIR share/doc/task/rc TASK_MAN1DIR share/man/man1 TASK_MAN5DIR share/man/man5 @@ -75,6 +76,7 @@ get absolute installation directories: CMAKE_INSTALL_PREFIX/TASK_BINDIR /usr/local/bin CMAKE_INSTALL_PREFIX/TASK_DOCDIR /usr/local/share/doc/task + CMAKE_INSTALL_PREFIX/TASK_RCDIR /usr/local/share/doc/task/rc CMAKE_INSTALL_PREFIX/TASK_MAN1DIR /usr/local/share/man/man1 CMAKE_INSTALL_PREFIX/TASK_MAN5DIR /usr/local/share/man/man5 diff --git a/LICENSE b/LICENSE index fa467597a..a48fa5537 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ taskwarrior - a command line task list manager. -Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +Copyright 2006-2014, 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 diff --git a/NEWS b/NEWS index 16d96bb6c..bb25945e3 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ New Features in taskwarrior 2.4.0 - - + - New commands in taskwarrior 2.4.0 @@ -9,13 +9,14 @@ New commands in taskwarrior 2.4.0 New configuration options in taskwarrior 2.4.0 - - Newly deprecated features in taskwarrior 2.4.0 - ---- +Known Issues + + - Taskwarrior has been built and tested on the following configurations: diff --git a/README_TASKD b/README_TASKD new file mode 100644 index 000000000..c923aa23b --- /dev/null +++ b/README_TASKD @@ -0,0 +1,93 @@ +Welcome To Taskwarrior 2.3.0 Beta +--------------------------------- + +The beta release of Taskwarrior 2.3.0 is for testing the Taskserver. There are +several unaddressed bugs in this release, so proper precautions with your data +are required. + + +Building Taskwarrior +-------------------- + +You will need the following dependencies: + + cmake + make + g++/clang or equivalent + libuuid + libgnutls (devel copy, with certtools) + libreadline + + +Configuring Taskwarrior as a Taskserver Client +---------------------------------------------- + +When a new user is added to the Taskserver, a UUID key is generated, along with +an x.509 cert. See Taskserver operation document. Before proceeding, you will +need the following items: + + Where Taskserver is running (Default: localhost:6544) + Name of organization (default: Public) + User name added to server + UUID generated by server + Full path to client.cert.pem generated by server + Full path to client.key.pem generated by server + +Set these configuration variables in your Taskwarrior configuration, +substituting from above: + + $ task config taskd.server + $ task config taskd.credentials // + $ task config taskd.certificate + $ task config taskd.key + +Here is an example: + + $ task config taskd.server localhost:6544 + $ task config taskd.credentials 'Public/John Doe/8ad2e3db-914d-4832-b0e6-72fa04f6e331' + $ task config taskd.certificate ~/.task/client.cert.pem + $ task config taskd.key ~/.task/client.key.pem + + +Using Self-Signed Certificates +------------------------------ + +If you are using self-signed certificates, you will either need a Certificate +Authority cert (CA), reference by hte configuration like this: + + $ task config taskd.ca ~/.task/ca.cert.pem + +Alternatively you can bypass the certificate validation, but this is not +recommended: + + $ task config taskd.trust yes + + +First-Time Synchronizing +------------------------ + +The first sync you do should be a full sync. Run this: + + $ task sync initialize + +This performs a full upload of your pending.data file to the server, creating +the basis on which all subsequent sync commands are run, and transferring only +deltas. + +Do not run 'task sync initialize' again. + + +General Synchronizing +--------------------- + +After the first-time sync, all subsequent sync commands should be like this: + + $ task sync + +It is safe to run this command as often as you wish, whether or not there are +any changes to sync. + +You may wish to enable sync feedback with the 'sync' verbose token. See 'man +taskrc' for details. + +--- diff --git a/cmake.h.in b/cmake.h.in index cd2be5e70..5739d4fdf 100644 --- a/cmake.h.in +++ b/cmake.h.in @@ -1,5 +1,8 @@ /* cmake.h.in. Creates cmake.h during a cmake run */ +/* Product identification */ +#define PRODUCT_TASKWARRIOR 1 + /* Package information */ #define PACKAGE "${PACKAGE}" #define VERSION "${VERSION}" @@ -10,7 +13,7 @@ #define PACKAGE_STRING "${PACKAGE_STRING}" /* Installation details */ -#define TASK_RCDIR "${CMAKE_INSTALL_PREFIX}/${TASK_DOCDIR}/rc" +#define TASK_RCDIR "${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}" /* Localization */ #define PACKAGE_LANGUAGE ${PACKAGE_LANGUAGE} @@ -18,6 +21,7 @@ #define LANGUAGE_ES_ES ${LANGUAGE_ES_ES} #define LANGUAGE_FR_FR ${LANGUAGE_FR_FR} #define LANGUAGE_DE_DE ${LANGUAGE_DE_DE} +#define LANGUAGE_IT_IT ${LANGUAGE_IT_IT} /* git information */ #cmakedefine HAVE_COMMIT @@ -48,23 +52,19 @@ /* Found the pthread library */ #cmakedefine HAVE_LIBPTHREAD -/* Found random */ -#cmakedefine HAVE_RANDOM - -/* Found srandom */ -#cmakedefine HAVE_SRANDOM - /* Found tm_gmtoff */ #cmakedefine HAVE_TM_GMTOFF /* Found timegm */ #cmakedefine HAVE_TIMEGM +/* Found st.st_birthtime struct member */ +#cmakedefine HAVE_ST_BIRTHTIME + /* Found get_current_dir_name */ #cmakedefine HAVE_GET_CURRENT_DIR_NAME -/* Found the uuid library */ -#cmakedefine HAVE_UUID +/* Found uuid_unparse_lower in the uuid library */ #cmakedefine HAVE_UUID_UNPARSE_LOWER /* Undefine this to eliminate the execute command */ diff --git a/cmake/Modules/FindReadline.cmake b/cmake/Modules/FindReadline.cmake index 83fe7bca0..8fdaec18f 100644 --- a/cmake/Modules/FindReadline.cmake +++ b/cmake/Modules/FindReadline.cmake @@ -9,36 +9,37 @@ # Apple readline does not support readline hooks # So we look for another one by default -IF (APPLE) +IF (APPLE OR FREEBSD) FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h PATHS + /usr/include/ /sw/include /opt/local/include /opt/include /usr/local/include - /usr/include/ NO_DEFAULT_PATH ) -ENDIF (APPLE) +ENDIF (APPLE OR FREEBSD) FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h) # Apple readline does not support readline hooks # So we look for another one by default -IF (APPLE) +IF (APPLE OR FREEBSD) FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline PATHS + /usr/lib /sw/lib /opt/local/lib /opt/lib /usr/local/lib - /usr/lib NO_DEFAULT_PATH ) -ENDIF (APPLE) +ENDIF (APPLE OR FREEBSD) FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline) # Sometimes readline really needs ncurses -IF (APPLE) +IF (APPLE OR FREEBSD) FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses PATHS + /usr/lib /sw/lib /opt/local/lib /opt/lib @@ -46,7 +47,7 @@ IF (APPLE) /usr/lib NO_DEFAULT_PATH ) -ENDIF (APPLE) +ENDIF (APPLE OR FREEBSD) FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses) MARK_AS_ADVANCED ( diff --git a/doc/man/task-color.5.in b/doc/man/task-color.5.in index 75f7fd1c7..3fef0f3ac 100644 --- a/doc/man/task-color.5.in +++ b/doc/man/task-color.5.in @@ -265,7 +265,7 @@ your .taskrc file (note that your installation may use a slightly different path from the example): .RS -include /usr/local/share/doc/task/rc/dark-256.theme +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/dark-256.theme .RE You can use any of the standard taskwarrior themes: @@ -304,7 +304,7 @@ Better yet, create your own, and share it. We will gladly host the theme file on . .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2013 P. Beckingham, F. Hernandez. +Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez. Taskwarrior is distributed under the MIT license. See http://www.opensource.org/licenses/mit-license.php for more information. diff --git a/doc/man/task-faq.5.in b/doc/man/task-faq.5.in index e6c0ee893..d0a78d974 100644 --- a/doc/man/task-faq.5.in +++ b/doc/man/task-faq.5.in @@ -72,9 +72,9 @@ reason to back up your task data files! .TP .B Q: Can I have two separate versions of taskwarrior installed? How? Yes, and here is one simple way to do that. Install the older version of -taskwarrior, and then rename the 'task' binary to something like 't194' to +taskwarrior, and then rename the 'task' binary to something like 't230' to reflect the version number. Then install the newer version, which will be -named 'task'. Now you have 't194' and 'task' both installed, both using the +named 'task'. Now you have 't230' and 'task' both installed, both using the same configuration and data. Note that the older version will not be aware of any new configuration settings @@ -86,6 +86,9 @@ Note also that the man pages will overwrite, which is why it is suggested that the older version be installed first, so that you benefit from improved documentation. +Is this a good idea? Not really. You should be using the latest software +whenever possible, enjoying the benefits of enhancements and bug fixes. + .TP .B Q: How do I build a Darwin 32bit version of task The taskwarrior packages will not work on a 32-bit OSX installation on Core @@ -159,11 +162,6 @@ new file, then this command lists only the defaults. Note that this is a good way to learn about new configuration settings, particularly if your .taskrc file was created by an older version. -.TP -.B Q: Do I need to back up my taskwarrior data? -Yes you do, like all your other files. You should back up all the files in your -~/.task directory, and your ~/.taskrc file too. - .TP .B Q: Can I share my tasks between different machines? Yes, you can. Most people have success with a DropBox - a free and secure file @@ -174,40 +172,25 @@ folder, by modifying the: configuration variable. Check out DropBox at http://www.dropbox.com. -You might also want to share the same .taskrc file. You can do this by putting an alias in the .bashrc file along the lines of - -alias task="task rc:/home/username/Dropbox/mysharedtaskrc" - -An alternative to Dropbox is to use the push/pull/merge features built into Taskwarrior. See 'man task-sync' for details. +You might also want to share the same .taskrc file. You can do this by putting +an alias in the .bashrc file along the lines of + alias task="task rc:/home/username/Dropbox/mysharedtaskrc" .TP .B Q: I don't want to use dropbox. Is there another way to synchronize my tasks? -Of course. Especially if you want to modify tasks offline on both machines and -synchronize them later on. For this purpose there is a 'merge' command which is -is able to insert the modifications you made to one of your task databases into -a second database. - -Here is a basic example of the procedure: - - task merge ssh://user@myremotehost/.task/ - task push ssh://user@myremotehost/.task/ - -The first command fetches the undo.data file from the remote system, reads the -changes made and updates the local database. When this merge command completes, -you should copy all the local .data files to the remote system either by using -the push command explicitly or by activating the merge.autopush feature in the -~/.taskrc file. This way you ensure that both systems are fully synchronized. +Yes. Get a Taskserver account, and sync tasks between all your machines and +devices. See task-sync(5). .TP .B Q: The undo.data file gets very large - do I need it? -You need it if you want the undo capability, or the merge capability mentioned -above. But if it gets large, you can certainly truncate it to save space, just -be careful to delete lines from the top of the file, up to and including a -separator '---'. The simplest way is to simply delete the undo.data file. Note -that it does not slow down taskwarrior in performance-sensitive areas, because -it is typically not read until you want to undo, or report total active time in -the 'info' command. Taskwarrior generally only appends to the file. +You need it if you want the undo capability. But if it gets large, you can +certainly truncate it to save space, just be careful to delete lines from the +top of the file, up to and including a separator '---'. The simplest way is to +simply delete the undo.data file. Note that it does not slow down taskwarrior +in performance-sensitive areas, because it is typically not read until you want +to undo, or report total active time in the 'info' command. Taskwarrior +generally only appends to the file. It is not recommended that you delete the undo.data file, as it limits functionality. @@ -262,7 +245,8 @@ Taskwarrior does this to always show you the smallest numbers it can. The idea is that if your tasks are numbered 1 - 33, for example, those are easy to type in. If instead task kept a rolling sequence number, after a while your tasks might be numbered 481 - 513, which makes it more likely to enter one -incorrectly, because there are more digits. +incorrectly, because there are more digits, and humans have difficulty with +longer numbers. When you run a report (such as "list"), the numbers are assigned before display. For example, you can do this: @@ -355,7 +339,7 @@ There are lots of ways. Here are some: - Fix bugs .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2013 P. Beckingham, F. Hernandez. +Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez. Taskwarrior is distributed under the MIT license. See http://www.opensource.org/licenses/mit-license.php for more information. diff --git a/doc/man/task-sync.5.in b/doc/man/task-sync.5.in index fa1cc3e25..03e00da84 100644 --- a/doc/man/task-sync.5.in +++ b/doc/man/task-sync.5.in @@ -1,361 +1,148 @@ .TH task-sync 5 2013-04-07 "${PACKAGE_STRING}" "User Manuals" .SH NAME -task-sync \- A tutorial for the task(1) data synchronization capabilities. +task-sync \- A discussion and tutorial for the various task(1) data +synchronization capabilities. -.SH DESCRIPTION -Taskwarrior has built-in support for synchronization, which can be used to keep -two task databases up to date, regardless of which one is used. This capability -can also be used to keep a backup copy of your task database on another machine. +.SH INTRODUCTION +Taskwarrior has several sync options, external and internal. If you wish to +sync your data, choose one method only; mixing methods is only going to lead to +problems. Each of the methods discussed have their own strengths. -Taskwarrior can use various protocols for transferring the data. - -.SH HOW IT WORKS -If you were to manually attempt to keep two separate task databases up to date, -you would need to inspect both databases, and detect changes that occurred in -each one. Those changes would need to be migrated to the other database, while -being careful not to miss a change, and not to confuse an 'add' in one with -a 'delete' in the other. - -The synchronization feature does just this. It can transfer task databases, -compare tasks, and apply changes where necessary. - -.SH NEW COMMANDS -Taskwarrior has 'pull', 'push' and 'merge' commands which perform the steps -necessary to move files around and combine them. In the common use case, you -would only need to use the 'merge' command. These commands take an argument -that is a URI, which indicates where the remote database resides. - -To be clear, the local database always refers to your ~/.task directory (unless -overridden), and the remote database is always specified by URI. - -.SH MERGE -The merge command will fetch task data via URI and combine it with the local -task database. The syntax is: +.SH ALTERNATIVES +There are three alternatives for syncing data, which are: +1) Version control systems, such as git, hg, svn .br -.RS -task merge [] -.RE - -The URI is optional if the -.B merge.default.uri -configuration variable is set. The URI may point to a different directory, or -it may be a different computer. Here is an example of the merge command: - +2) File hosting systems, such as DropBox .br -.RS -$ task merge ~/work/ -.RE +3) Using the Taskserver and the 'sync' command -This URI (~/work/) is a path name, which means the remote database is on the -same computer. Taskwarrior will fetch the data from the URI, and merge it with -your local data in ~/.task. -When complete, you will be asked whether you would like to push the combined -data back to the remote location specified by the URI. This is useful if you -are keeping two task databases synchronized, but it can be turned off. See -CONFIGURATION. +.SH OPTION 1: VERSION CONTROL SYSTEMS +There are several good, distributed VCS systems (git, hg, ...) and centralized +VCS systems (svn ...), and they function in a similar fashion for our purposes. -Note that a merge operation is not atomically reversible. You could however -run the 'task undo' command repeatedly to undo the effects. - -.SH PUSH -The push command will copy the local task database to the specified URI. The -syntax is: +Setup is straightforward. You place your .task directory under revision +control. You then need to perform a regular commit/push/pull/update to make +sure that the data is propagated when needed. You can even do this using shell +scripts so that every task command is preceded by a 'pull' and followed by a +'push'. +Strengths: .br -.RS -task push [] -.RE - -The URI is optional if the -.B push.default.uri -configuration variable is set. This command is useful for making backup copies -of your task database. - -Note that the task files at the location specified by the URI are simply -overwritten, so don't expect any merging to occur. Misused, push can be -dangerous. - -.SH PULL -The pull command will copy a task database from a URI to the local task database -(~/.task by default). The syntax is: - + - Good data transport mechanisms .br -.RS -task pull [] -.RE - -The URI is optional if the -.B pull.default.uri -configuration variable is set. This command is useful for restoring a backup -copy of your task database. - -Note that your local task database files will be simply overwritten by the files -obtained from the location specified by the URI, so don't expect any merging to -occur. Misused, pull can be dangerous. - -.SH URI TYPES -The most basic URI is a path name on the local machine. An example would be: + - Secure transport options +Weaknesses: .br -.RS -/home/bob/.task/ -.RE - -All the other URIs allow access to remote machines. The first uses SSH and scp -(either form can be used): - + - You need proficiency with VCS tools .br -.RS -ssh://[user@]host[:port]/absolute/path/to/.task/ + - You will need to manually resolve conflicts frequently .br -[user@]host:/absolute/path/to/.task/ -.RE + - You need to provide the mechanism for making sure copies are up to date -In both cases paths are considered to be absolute. You can specify paths relative to the -users home directory as follows: +.SH OPTION 2: FILE HOSTING SERVICES +There are many file hosting services, such as DropBox, Amazon S3, Google Drive, +SkyDrive and more. This technique involves storing your .task directory in a +shared directory under the control of the file hosting services. + +Syncing happens quickly, although it is possible to run into conflict situations +when there is no network connectivity, and the tasks are modified in two +separate locations. This is because the file hosting service knows only about +files, and it has no idea how to merge tasks. Avoid this problem by never +modifying the same task on two machines, without an intervening sync. + +Setup simply involves creating the directory and modifying your data.location +configuration variable like this: + + $ task config data.location /path/to/shared/directory + +Strengths: .br -.RS -ssh://[user@]host[:port]/.task/ + - Always secure .br -[user@]host:.task/ -.RE - -or even shorter - + - Good client support .br -.RS -[user@]host:.task/ -.RE - -Remark: Since taskwarrior simply calls the scp binary you can specify very much anything -that scp would accept, e.g. host configurations from ~/.ssh/config or ~username -expansion: - + - Easy setup .br -.RS -ssh://configured-host/~[username]/.task/ + - Transparent use + +Weaknesses: .br -configured-host:~[username]/.task/ -.RE + - Tasks are not properly merged -Rsync is another supported protocol that minimizes network traffic, by a clever -algorithm that doesn't copy files that have not changed: +.SH OPTION 3: TASKSERVER +The Taskserver was designed for this purpose to be secure, fast and conflict +free, allowing data interchange between assorted Taskwarrior clients, and +tolerant of network connectivity problems. +There is a 'sync' command built in to Taskwarrior, and with a server account +and client configuration, syncing is done on demand. + +Setup is a matter of creating an account on a Taskserver (see your Taskserver +provider or operate your own - see +http://taskwarrior.org/projects/taskwarrior/wiki/Server_setup) + +Once you have an account, you'll receive a certificate, key and a password. +You'll need to put the certificate and key somewhere like this: + + $ cp .cert.pem ~/.task + $ cp .key.pem ~/.task + +Then you configure Taskwarrior, using the account details: + + $ task config taskd.certificate ~/.task/.cert.pem + $ task config taskd.key ~/.task/.key.pem + $ task config taskd.credentials // + $ task config taskd.server : + +If you are using a private server, you are likely also using a self-signed +certificate, which means you will need one of the following additional entries: + + $ task config taskd.ca ~/.task/ca.cert.pem + +The CA (Certificate Authority) will be used to verify the server certificate. +Alternatively, you can override the cert verification process using: + + $ task config taskd.trust yes + +This is an insecure option that should be used with caution, because it directs +Taskwarrior to trust any certificate. + +After setup, you run a one-time sync initialization, like this: + + $ task sync initialize + +This will make sure your client and the server are properly in sync to begin +with. From this point on, you never run the 'initialize' command again, just +go about your business, and when you want to sync, run this: + + $ task sync + +You'll see a summary of how many tasks were uploaded and downloaded. You can +safely run the command as often as you like. When there are no changes to sync, +nothing happens. If you do not have connectivity, your task changes accumulate +so that when you next run 'sync' with proper connectivity, the changes are +properly handled, in the right order. + +Strengths: .br -.RS -rsync://[user@]host.xz[:port]/path/to/.task/ -.RE - -Curl supports several protocols that can transfer data using HTTP, HTTPS and -FTP: - + - Always secure .br -.RS -http://host[:port]/path/to/.task/ + - Minimal bandwidth .br -https://host[:port]/path/to/.task/ + - Tolerates connectivity outage + +Weaknesses: .br -ftp://[user@]host[:port]/path/to/.task/ -.RE - -You can use single quotes to encapsulate user names that contain delimiting -characters like '@', '/' or ':', e.g.: - -.br -.RS -ssh://'user@name'@host/ -.RE - -Remember to escape the quotes on your shell: - -.br -.RS -$ task push ftp://\'user@name\':host/ -.RE - -.SH CONFLICTS -When modifications on the local and remote machine conflict, for example if -both machines change the project name of the same task to different values, -then Taskwarrior automatically selects the most recent change. Thus, there -are no conflicts. - -.SH EXAMPLE - Backup on another machine -One very good use of 'push' is to make backup copies of your task database in -another location. Suppose your task database is kept in the usual place, in -the ~/.task directory, and you wanted to make a backup copy in ~/backup. You -would use this command: - -.br -.RS -$ task push ~/backup/ -.RE - -This would copy the files in ~/.task to ~/backup, overwriting the files that -were already in ~/backup. To backup your files to another machine, you could -use: - -.br -.RS -$ task push user@host:backup -.RE - -This could be improved by setting the -.B push.default.uri -configuration variable and then relying on the default, like this: - -.br -.RS -$ task config push.default.uri user@host:backup -.RE - -and then you need only run the push command: - -.br -.RS -$ task push -.RE - -and the default push URI will be used. If you wanted to restore a backup, you -simply use the pull command instead: - -.br -.RS -$ task pull user@host:backup -.RE - -This can be simplified by setting the -.B pull.default.uri -configuration variable and then relying on the default, like this: - -.br -.RS -$ task config pull.default.uri user@host:backup -.RE - -Note that pull and push will blindly overwrite the task files without any -merging. Be careful. - -.SH EXAMPLE - Keeping two task databases synchronized -The most common synchronization will be to keep two task databases synchronized -on different machines. Here is a full example, including setup that illustrates -this. - -Suppose there are two machines, named 'local' and 'remote', for simplicity. -Taskwarrior is installed on both machines. The different machines are -indicated here by the prompt. Suppose Alice enters two tasks on her local -machine: - -.br -.RS -local> task add Deliver the new budget proposal due:tuesday -.br -local> task add Set up a meeting with Bob -.RE - -Then later adds a task on the remote machine: - -.br -.RS -remote> task add Present the budget proposal at the big meeting due:thursday -.RE - -Now on the local machine, Alice merges the two task databases: - -.br -.RS -local> task merge alice@remote:.task -.br -Would you like to push the changes to 'alice@remote:.task'? Y -.RE - -Taskwarrior has combined the two task databases on local, then pushed the -changes back to remote. Now suppose Alice changes the due date for task 1 -on remote: - -.br -.RS -remote> task 1 due:wednesday -.RE - -Now on the local machine, Alice sets up a default URI and autopush: - -.br -.RS -local> task config merge.default.uri alice@remote:.task -.br -local> task config merge.autopush yes -.RE - -Now Alice can simply run merge to make sure that the new due date is copied to -the local machine: - -.br -.RS -local> task merge -.RE - -This time the URI is determined automatically, and after the merge the files are -pushed back to the remote machine. In a similar way, the remote machine can -also be configured to merge from the local machine and push back to it. Then it -is just a matter of Alice remembering to merge now and then, from either -machine, to have her data in two (or even more) places. - -.SH CONFIGURATION -By setting these configuration variables, it is possible to simplify the -synchronization commands, by relying on the defaults or alias names. - -.br -.B merge.autopush=yes|no|ask -.RS -This controls whether the automatic push after a merge is performed, not -performed, or whether the user is asked every time. The default value is 'ask'. -.RE - -.br -.B merge.default.uri= -.RS -Sets a default URI so that just the 'task merge' command be run without the -need to retype the URI every time. You can also use this configuration scheme -to set alias names, e.g. set merge.desktop.uri and run 'task merge desktop'. -.RE - -.br -.B push.default.uri= -.RS -Sets a default URI so that just the 'task push' command be run without the -need to retype the URI every time. You can also use this configuration scheme -to set alias names, e.g. set push.desktop.uri and run 'task push desktop'. -.RE - -.br -.B pull.default.uri= -.RS -Sets a default URI so that just the 'task pull' command be run without the -need to retype the URI every time. You can also use this configuration scheme -to set alias names, e.g. set pull.desktop.uri and run 'task pull desktop'. -.RE - -Note that, when using SSH/scp, hostnames will be expanded due to the ssh -configuration file ~/.ssh/config. - -.SH EXTERNAL DEPENDENCIES -Depending on the URI protocols used, the utilities 'scp', 'rsync' and 'curl' -must be installed and accessible via the $PATH environment variable. - -If you have deleted your ~/.task/undo.data file to save space, you will be -unable to merge. The change transactions stored in the undo.data file are -used for synchronization. + - You need to manage your own server, or gain access to a hosted server. .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2013 P. Beckingham, F. Hernandez. - -The sync capabilities were written by J. Schlatow. -Parts copyright (C) 2010 - 2013 J. Schlatow. +Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez. Taskwarrior is distributed under the MIT license. See http://www.opensource.org/licenses/mit-license.php for more information. @@ -367,7 +154,6 @@ http://www.opensource.org/licenses/mit-license.php for more information. .BR task-faq(5), .BR task-color(5), .BR task-tutorial(5), -.BR ssh_config(5) For more information regarding task, the following may be referenced: diff --git a/doc/man/task-tutorial.5.in b/doc/man/task-tutorial.5.in index 135ca875b..803476e6c 100644 --- a/doc/man/task-tutorial.5.in +++ b/doc/man/task-tutorial.5.in @@ -1286,19 +1286,19 @@ theme into the configuration file, you can see some striking effects. For a blue theme, add this line to your .taskrc file: .RS -include /usr/local/share/doc/task/rc/dark-blue-256.theme +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/dark-blue-256.theme .RE For a red theme: .RS -include /usr/local/share/doc/task/rc/dark-red-256.theme +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/dark-red-256.theme .RE For a general dark theme: .RS -include /usr/local/share/doc/task/rc/dark-256.theme +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/dark-256.theme .RE Here are two color rules that specify a dark blue background for all tasks that @@ -1497,7 +1497,7 @@ used most. You can create your own, or use one of the samples to show holidays on the calendar. Try adding this line to your ~/.taskrc file: .RS -include /usr/local/share/doc/task/rc/holidays.en-US.rc +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/holidays.en-US.rc .RE Then: @@ -3081,7 +3081,7 @@ $ task help .RE .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2013 P. Beckingham, F. Hernandez. +Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez. This man page was originally written by Federico Hernandez, and has been modified and supplemented by Paul Beckingham. diff --git a/doc/man/task.1.in b/doc/man/task.1.in index 890937554..156ccbe9d 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -144,8 +144,8 @@ Shows a graphical burndown chart, by month. .B task calendar [due| |] [y] Shows a monthly calendar with due tasks marked. Shows one horizontal line of months. If the 'y' argument is provided, will show at least one complete year. -If a year is provided, such as '2013', then that full year is shown. If both -a month and a year are specified ('6 2013') then the months displayed begin at +If a year is provided, such as '2014', then that full year is shown. If both +a month and a year are specified ('6 2014') then the months displayed begin at the specified month and year. If the 'due' argument is provided, will show the starting month of the earliest due task. @@ -173,7 +173,18 @@ Displays only a count of tasks matching the filter. Exports all tasks in the JSON format. Redirect the output to a file, if you wish to save it, or pipe it to another command or script to convert it to another format. The standard task release comes with a few example scripts, -such as export-yaml.pl. +such as: + + export-csv.pl + export-sql.py + export-xml.py + export-yaml.pl + export-html.pl + export-tsv.pl + export-xml.rb + export-ical.pl + export-xml.pl + export-yad.pl .TP .B task ghistory.annual @@ -335,29 +346,15 @@ provided for exceptional circumstances. Use carefully. .TP .B task import [ ...] Imports tasks in the JSON format. The standard task release comes with a few -example scripts, such as import-yaml.pl. +example scripts, such as: + + import-todo.sh.pl + import-yaml.pl .TP .B task log Adds a new task that is already completed, to the task list. -.TP -.B task merge -Merges two task databases by comparing the modifications that are stored in the -undo.data files. The location of the second undo.data file must be passed on as -argument. URL may have the following syntaxes: - - ssh://[user@]host.xz[:port]/path/to/.task/ - - rsync://[user@]host.xz[:port]/path/to/.task/ - - [user@]host.xz:path/to/.task/ - - /path/to/local/.task/ - -You can set aliases for frequently used URLs in the .taskrc. Further -documentation can be found in the task-sync(5) man page. - .TP .B task modify Modifies the existing task with provided information. @@ -366,17 +363,6 @@ Modifies the existing task with provided information. .B task prepend Prepends description text to an existing task. -.TP -.B task pull -Overwrites the task database with those files found at the URL. -(See 'merge' command for valid URL syntax.) - -.TP -.B task push -Pushes the task database to a remote location for distributing the -changes made by the merge command. -(See 'merge' command for valid URL syntax.) - .TP .B task start Marks the specified tasks as started. @@ -533,6 +519,24 @@ Shows the IDs and descriptions of matching tasks. .B task _zshuuids Shows the UUIDs and descriptions of matching tasks. +.TP +.B task _get [ ...] +Accesses and displays the DOM reference(s). Used to extract individual values +from tasks, or the system. Supported DOM references are: + + rc. + context.program + context.args + context.width + context.height + system.version + system.os + . + . + +Note that the 'rc.' reference may need to be escaped using '--' to prevent +the reference from being interpreted as an override. + .SH ATTRIBUTES AND METADATA .TP @@ -570,9 +574,13 @@ are: DUE Matches if the task is due DUETODAY Matches if the task is due today TODAY Matches if the task is due today + WEEK Matches if the task is due this week + MONTH Matches if the task is due this month + YEAR Matches if the task is due this year OVERDUE Matches if the task is overdue ACTIVE Matches if the task is started SCHEDULED Matches if the task is scheduled + PARENT Matches if the task is a parent CHILD Matches if the task has a parent UNTIL Matches if the task expires WAITING Matches if the task is waiting @@ -882,6 +890,22 @@ This sets the wait date to 1/18/2038. .TP Next occurring weekday task ... due:fri + +.TP +Predictable holidays +task ... due:goodfriday +.br +task ... due:easter +.br +task ... due:eastermonday +.br +task ... due:ascension +.br +task ... due:pentecost +.br +task ... due:midsommar +.br +task ... due:midsommarafton .RE .SS FREQUENCIES @@ -1057,10 +1081,10 @@ The file that contains the completed ("done") tasks. .TP ~/.task/undo.data -The file that contains information needed by the "undo" and "merge" commands. +The file that contains information needed by the "undo" command. .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2013 P. Beckingham, F. Hernandez. +Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez. Taskwarrior is distributed under the MIT license. See http://www.opensource.org/licenses/mit-license.php for more information. diff --git a/doc/man/taskrc.5.in b/doc/man/taskrc.5.in index 5081f0db4..edcd7997c 100644 --- a/doc/man/taskrc.5.in +++ b/doc/man/taskrc.5.in @@ -80,6 +80,8 @@ The hash mark, or pound sign ("#") is used as a comment character. It can be used to annotate the configuration file. All text after the character to the end of the line is ignored. +The configuration file supports UTF8 as well as JSON encoding, such as \\uNNNN. + Note that taskwarrior is flexible about the values used to represent Boolean items. You can use "on", "yes", "y", "1" and "true". Anything else means "off". @@ -89,7 +91,7 @@ You can edit your .taskrc file by hand if you wish, or you can use the 'config' command. To permanently set a value in your .taskrc file, use this command: .RS -$ task config nag "You have higher priority tasks!" +$ task config nag "You have more urgent tasks." .RE To delete an entry, use this command: @@ -129,9 +131,9 @@ ones containing just the relevant configuration data like colors, etc. There are two excellent uses of includes in your .taskrc, shown here: .RS -include /usr/local/share/doc/task/rc/holidays.en-US.rc +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/holidays.en-US.rc .br -include /usr/local/share/doc/task/rc/dark-16.theme +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/dark-16.theme .RE This includes two standard files that are distributed with taskwarrior, which @@ -139,7 +141,7 @@ define a set of US holidays, and set up a 16-color theme to use, to color the reports and calendar. .SH ENVIRONMENT VARIABLES -These environmant variables override defaults and command line arguments. +These environment variables override defaults and command line arguments. .TP .B TASKDATA=~/.task @@ -304,11 +306,11 @@ variable is "no". This is useful for preventing large-scale unintended changes. .TP -.B nag=You have higher priority tasks. +.B nag=You have more urgent tasks. This may be a string of text, or blank. It is used as a prompt when a task is started or completed that is not considered high priority. Default value is: -You have higher priority tasks. It is a gentle reminder that you are -contradicting your own priority settings. +You have more urgent tasks. It is a gentle reminder that you are contradicting +your own priority settings. .TP .B complete.all.projects=yes @@ -445,6 +447,10 @@ debug output can be useful. It can also help explain how the command line is being parsed, but the information is displayed in a developer-friendly, not a user-friendly way. +.TP +.B debug.tls=0 +Controls the GnuTLS log level. For 'sync' debugging. + .TP .B alias.rm=delete Taskwarrior supports command aliases. This alias provides an alternate name @@ -486,41 +492,45 @@ characters: .RS .RS -m minimal-digit month, for example 1 or 12 +m minimal-digit month, for example 1 or 12 .br -d minimal-digit day, for example 1 or 30 +d minimal-digit day, for example 1 or 30 .br -y two-digit year, for example 09 or 12 +y two-digit year, for example 09 or 12 .br -D two-digit day, for example 01 or 30 +D two-digit day, for example 01 or 30 .br -M two-digit month, for example 01 or 12 +M two-digit month, for example 01 or 12 .br -Y four-digit year, for example 2009 or 2013 +Y four-digit year, for example 2009 or 2014 .br -a short name of weekday, for example Mon or Wed +a short name of weekday, for example Mon or Wed .br -A long name of weekday, for example Monday or Wednesday +A long name of weekday, for example Monday or Wednesday .br -b short name of month, for example Jan or Aug +b short name of month, for example Jan or Aug .br -B long name of month, for example January or August +B long name of month, for example January or August .br -v minimal-digit week, for example 3 or 37 +v minimal-digit week, for example 3 or 37 .br -V two-digit week, for example 03 or 37 +V two-digit week, for example 03 or 37 .br -h minimal-digit hour, for example 3 or 21 +h minimal-digit hour, for example 3 or 21 .br -n minimal-digit minutes, for example 5 or 42 +n minimal-digit minutes, for example 5 or 42 .br -s minimal-digit seconds, for example 7 or 47 +s minimal-digit seconds, for example 7 or 47 .br -H two-digit hour, for example 03 or 21 +H two-digit hour, for example 03 or 21 .br -N two-digit minutes, for example 05 or 42 +N two-digit minutes, for example 05 or 42 .br -S two-digit seconds, for example 07 or 47 +S two-digit seconds, for example 07 or 47 +.br +J three-digit Julian day, for example 023 or 365 +.br +j Julian day, for example 23 or 365 .RE .RE @@ -701,7 +711,7 @@ be included like this: .RS .RS .br -include /usr/local/share/doc/task/rc/holidays.en-US.rc +include ${CMAKE_INSTALL_PREFIX}/${TASK_RCDIR}/holidays.en-US.rc .RE .RE @@ -835,7 +845,7 @@ Colors any task where the description or any annotation contains X. .TP .B color.uda.X=on green -Colors any taks that has the user defined attribute X. +Colors any task that has the user defined attribute X. .RE .TP @@ -957,7 +967,7 @@ a change that is to be reverted. .br .B color.sync.rejected=red .RS -Colors the output of the merge command. +Colors the output of the sync command. .RE .TP @@ -1040,6 +1050,7 @@ Specific tag coefficient. .B urgency.user.project..coefficient=... .RS Specific project coefficient. +.RE .B urgency.uda..coefficient=... .RS Presence/absence of UDA data. @@ -1078,31 +1089,6 @@ shadow.notify=on When this value is set to "on", taskwarrior will display a message whenever the shadow file is updated by some task command. -.SS PUSH/PULL/MERGE - -See the 'man task-synch' page for more details regarding usage. - -.TP -.B merge.autopush=yes|no|ask -.RS -Determines post-merge behavior regarding automatic push. -.RE - -.B merge.default.uri -.RS -Default merge URI. -.RE - -.B pull.default.uri -.RS -Default pull URI. -.RE - -.B push.default.uri -.RS -Default push URI. -.RE - .SS DEFAULTS .TP @@ -1126,6 +1112,13 @@ Provides a default due date for the .I task add command, if you don't specify one. The default is blank. +.TP +.B +uda..default=... +Provides default values for UDA fields when using the +.I task add +command, if you don't specify values. The default is blank. + .TP .B default.command=next @@ -1173,11 +1166,8 @@ The description for report X when running the "task help" command. .TP .B report.X.columns -The columns that will be used when generating the report X. Valid columns are: -id, uuid, status, project, priority, priority_long, entry, start, end, due, -countdown, countdown_compact, age, age_compact, active, tags, depends, -description_only, description, recur, recurrence_indicator, tag_indicator and -wait. The IDs are separated by commas. +This is a comma-separated list of columns and formatting specifiers. See the +command 'task columns' for a full list of options and examples. .TP .B report.X.labels @@ -1191,7 +1181,7 @@ specified by using the column ids post-fixed by a "+" for ascending sort order or a "-" for descending sort order. The sort IDs are separated by commas. For example: - report.list.sort=due+,priority-,active-,project+ + report.list.sort=due+,priority-,start.active-,project+ .TP .B report.X.filter @@ -1330,8 +1320,63 @@ of a task. .B uda.estimate.values=trivial,small,medium,large,huge .RE +.SS SYNC + +These configuration settings are used to connect and sync tasks with the task +server. + +.TP +.B taskd.server=: +.RS +Specifies the hostname and port of the Taskserver. Hostname may be an IPv4 or +IPv6 address, or domain. Port is an integer. +.RE + +.TP +.B taskd.credentials=// +.RS +User identification for the Taskserver, which includes a private key. +.RE + +.TP +.B taskd.certificate= +.RS +Specifies the path to the client certificate used for identification with the +Taskserver. +.RE + +.TP +.B taskd.key= +.RS +Specifies the path to the client key used for encrypted communication with the +Taskserver. +.RE + +.TP +.B taskd.ca= +.RS +Specifies the path to the CA certificate in the event that your Taskserver is +using a self-signed certificate. Optional. +.RE + +.TP +.B taskd.trust=yes|no +.RS +If you do not specify a CA certificate when your Taskserver is using a self- +signed certificate, you can override the certificate validation by setting this +value to 'yes'. Default is not to trust a server certificate. +.RE + +.TP +.B taskd.ciphers=NORMAL +Override of the cipher selection. The set of ciphers used by TLS may be +controlled by both server and client. There must be some overlap between +client and server supported ciphers, or communication cannot occur. +Default is "NORMAL". See GnuTLS documentation for full details. +.RE + .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2013 P. Beckingham, F. Hernandez. +Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez. This man page was originally written by Federico Hernandez. diff --git a/doc/man/tasksh.1.in b/doc/man/tasksh.1.in index 75c1065ff..f527e5b40 100644 --- a/doc/man/tasksh.1.in +++ b/doc/man/tasksh.1.in @@ -149,7 +149,7 @@ ID Project Pri Due Active Age Description .RE .SH "CREDITS & COPYRIGHTS" -Copyright (C) 2006 \- 2013 P. Beckingham, F. Hernandez. +Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez. This man page was originally written by Federico Hernandez. diff --git a/doc/misc/tutorial/extra.txt b/doc/misc/tutorial/extra.txt index 907f9b385..98c50e17c 100644 --- a/doc/misc/tutorial/extra.txt +++ b/doc/misc/tutorial/extra.txt @@ -5,10 +5,7 @@ Calendar trick Metadata Sync - push - pull - merge - sync (needs 2.3.0 & task server) + sync (needs 2.3.0 & Taskserver) Logo? diff --git a/doc/rc/dark-16.theme b/doc/rc/dark-16.theme index 43aad430a..1ae866f90 100644 --- a/doc/rc/dark-16.theme +++ b/doc/rc/dark-16.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/dark-256.theme b/doc/rc/dark-256.theme index ae5a60116..c78cfa9a6 100644 --- a/doc/rc/dark-256.theme +++ b/doc/rc/dark-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/dark-blue-256.theme b/doc/rc/dark-blue-256.theme index 34084d7d6..9ece9bd3b 100644 --- a/doc/rc/dark-blue-256.theme +++ b/doc/rc/dark-blue-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/dark-gray-256.theme b/doc/rc/dark-gray-256.theme index 91b66b628..c9dc9cf2a 100644 --- a/doc/rc/dark-gray-256.theme +++ b/doc/rc/dark-gray-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/dark-green-256.theme b/doc/rc/dark-green-256.theme index e1fa4a1af..e5bb9a58a 100644 --- a/doc/rc/dark-green-256.theme +++ b/doc/rc/dark-green-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/dark-red-256.theme b/doc/rc/dark-red-256.theme index abdd461b5..b5b89d06e 100644 --- a/doc/rc/dark-red-256.theme +++ b/doc/rc/dark-red-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/dark-violets-256.theme b/doc/rc/dark-violets-256.theme index 10d0eab5c..1537fab8c 100644 --- a/doc/rc/dark-violets-256.theme +++ b/doc/rc/dark-violets-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/dark-yellow-green.theme b/doc/rc/dark-yellow-green.theme index 6cd9aa6d0..d8c287172 100644 --- a/doc/rc/dark-yellow-green.theme +++ b/doc/rc/dark-yellow-green.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.be-BY.rc b/doc/rc/holidays.be-BY.rc index d934e3fed..55a327b5b 100644 --- a/doc/rc/holidays.be-BY.rc +++ b/doc/rc/holidays.be-BY.rc @@ -3,7 +3,7 @@ # http://holidata.net/be-BY/2013.json # http://holidata.net/be-BY/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.cs-CZ.rc b/doc/rc/holidays.cs-CZ.rc index 19dd116fe..84def6de3 100644 --- a/doc/rc/holidays.cs-CZ.rc +++ b/doc/rc/holidays.cs-CZ.rc @@ -3,7 +3,7 @@ # http://holidata.net/cs-CZ/2013.json # http://holidata.net/cs-CZ/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.da-DK.rc b/doc/rc/holidays.da-DK.rc index ea3e6e493..072cabce9 100644 --- a/doc/rc/holidays.da-DK.rc +++ b/doc/rc/holidays.da-DK.rc @@ -3,7 +3,7 @@ # http://holidata.net/da-DK/2013.json # http://holidata.net/da-DK/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.de-AT.rc b/doc/rc/holidays.de-AT.rc index 8e9fb3989..3058f28bd 100644 --- a/doc/rc/holidays.de-AT.rc +++ b/doc/rc/holidays.de-AT.rc @@ -3,7 +3,7 @@ # http://holidata.net/de-AT/2013.json # http://holidata.net/de-AT/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.de-DE.rc b/doc/rc/holidays.de-DE.rc index 6654c237c..8af072fa5 100644 --- a/doc/rc/holidays.de-DE.rc +++ b/doc/rc/holidays.de-DE.rc @@ -3,7 +3,7 @@ # http://holidata.net/de-DE/2013.json # http://holidata.net/de-DE/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.en-CA.rc b/doc/rc/holidays.en-CA.rc index 2c2d40413..08bce3811 100644 --- a/doc/rc/holidays.en-CA.rc +++ b/doc/rc/holidays.en-CA.rc @@ -3,7 +3,7 @@ # http://holidata.net/en-CA/2013.json # http://holidata.net/en-CA/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.en-GB.rc b/doc/rc/holidays.en-GB.rc index 9ff0bf86d..cee735917 100644 --- a/doc/rc/holidays.en-GB.rc +++ b/doc/rc/holidays.en-GB.rc @@ -3,7 +3,7 @@ # http://holidata.net/en-GB/2013.json # http://holidata.net/en-GB/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.en-NZ.rc b/doc/rc/holidays.en-NZ.rc index be2e5d83c..80c98ae03 100644 --- a/doc/rc/holidays.en-NZ.rc +++ b/doc/rc/holidays.en-NZ.rc @@ -3,7 +3,7 @@ # http://holidata.net/en-NZ/2013.json # http://holidata.net/en-NZ/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.en-US.rc b/doc/rc/holidays.en-US.rc index 580b476aa..f54114639 100644 --- a/doc/rc/holidays.en-US.rc +++ b/doc/rc/holidays.en-US.rc @@ -3,7 +3,7 @@ # http://holidata.net/en-US/2013.json # http://holidata.net/en-US/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.es-ES.rc b/doc/rc/holidays.es-ES.rc index eb44d8bf9..4f7fc54ff 100644 --- a/doc/rc/holidays.es-ES.rc +++ b/doc/rc/holidays.es-ES.rc @@ -3,7 +3,7 @@ # http://holidata.net/es-ES/2013.json # http://holidata.net/es-ES/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.fr-FR.rc b/doc/rc/holidays.fr-FR.rc index 8679d3c9d..06e8dfc3d 100644 --- a/doc/rc/holidays.fr-FR.rc +++ b/doc/rc/holidays.fr-FR.rc @@ -3,7 +3,7 @@ # http://holidata.net/fr-FR/2013.json # http://holidata.net/fr-FR/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.it-IT.rc b/doc/rc/holidays.it-IT.rc index 1ff0f77bd..53fd6f8ea 100644 --- a/doc/rc/holidays.it-IT.rc +++ b/doc/rc/holidays.it-IT.rc @@ -3,7 +3,7 @@ # http://holidata.net/it-IT/2013.json # http://holidata.net/it-IT/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.jp-JP.rc b/doc/rc/holidays.jp-JP.rc index 115677888..163763ada 100644 --- a/doc/rc/holidays.jp-JP.rc +++ b/doc/rc/holidays.jp-JP.rc @@ -3,7 +3,7 @@ # http://holidata.net/jp-JP/2013.json # http://holidata.net/jp-JP/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.nb-NO.rc b/doc/rc/holidays.nb-NO.rc index dd2cb5e52..d5fdb50be 100644 --- a/doc/rc/holidays.nb-NO.rc +++ b/doc/rc/holidays.nb-NO.rc @@ -3,7 +3,7 @@ # http://holidata.net/nb-NO/2013.json # http://holidata.net/nb-NO/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.nl-NL.rc b/doc/rc/holidays.nl-NL.rc index 19a76e90c..0315a5770 100644 --- a/doc/rc/holidays.nl-NL.rc +++ b/doc/rc/holidays.nl-NL.rc @@ -3,7 +3,7 @@ # http://holidata.net/nl-NL/2013.json # http://holidata.net/nl-NL/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/holidays.sv-SE.rc b/doc/rc/holidays.sv-SE.rc index 8c88132a6..9af4cf9a7 100644 --- a/doc/rc/holidays.sv-SE.rc +++ b/doc/rc/holidays.sv-SE.rc @@ -3,7 +3,7 @@ # http://holidata.net/sv-SE/2013.json # http://holidata.net/sv-SE/2014.json # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/light-16.theme b/doc/rc/light-16.theme index 8daf575e6..6e98a446a 100644 --- a/doc/rc/light-16.theme +++ b/doc/rc/light-16.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/light-256.theme b/doc/rc/light-256.theme index f3bb6de27..5a3555bdb 100644 --- a/doc/rc/light-256.theme +++ b/doc/rc/light-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/doc/rc/solarized-dark-256.theme b/doc/rc/solarized-dark-256.theme index 794643216..df4d21cc4 100644 --- a/doc/rc/solarized-dark-256.theme +++ b/doc/rc/solarized-dark-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, Paul Beckingham, Federico Hernandez. # # Colors used are based on the Solarized palette created by Ethan Schoonover # diff --git a/doc/rc/solarized-light-256.theme b/doc/rc/solarized-light-256.theme index a38d47629..ea7b3167c 100644 --- a/doc/rc/solarized-light-256.theme +++ b/doc/rc/solarized-light-256.theme @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, Paul Beckingham, Federico Hernandez. # # Colors used are based on the Solarized palette created by Ethan Schoonover # diff --git a/doc/ref/task-ref.pages b/doc/ref/task-ref.pages index b3b35b79a..9ef3ddd00 100644 Binary files a/doc/ref/task-ref.pages and b/doc/ref/task-ref.pages differ diff --git a/doc/ref/task-ref.pdf b/doc/ref/task-ref.pdf index 6e548d4b5..6f75c49d7 100644 Binary files a/doc/ref/task-ref.pdf and b/doc/ref/task-ref.pdf differ diff --git a/package-config/osx/README b/package-config/osx/README index 183b48f75..89aa52767 100644 --- a/package-config/osx/README +++ b/package-config/osx/README @@ -242,7 +242,7 @@ Note: This is being written from the OSX 10.6 perspective, and may therefore $ /usr/local/bin/task version task 2.0.0 built for darwin - Copyright (C) 2006 - 2013 P. Beckingham, F. Hernandez. + Copyright (C) 2006 - 2014 P. Beckingham, F. Hernandez. Taskwarrior may be copied only under the terms of the GNU General Public License, which may be found in the taskwarrior source kit. diff --git a/performance/.gitignore b/performance/.gitignore index 0c09a71d4..e82c8156a 100644 --- a/performance/.gitignore +++ b/performance/.gitignore @@ -1,2 +1,3 @@ *.data *.rc +export.json diff --git a/performance/run_perf b/performance/run_perf index 92d9a9ad3..f953930f6 100755 --- a/performance/run_perf +++ b/performance/run_perf @@ -2,7 +2,7 @@ echo 'Performance: setup' echo ' - This step will take several minutes' -rm -f ./pending.data ./completed.data ./undo.data perf.rc +rm -f ./pending.data ./completed.data ./undo.data ./backlog.data perf.rc ./load # Run benchmarks. @@ -26,6 +26,14 @@ echo ' - task add...' ../src/task rc.debug:1 rc:perf.rc add >/dev/null 2>&1 ../src/task rc.debug:1 rc:perf.rc add This is a task with an average sized description length project:P priority:H +tag1 +tag2 2>&1 | grep "Perf task" +echo ' - task export...' +../src/task rc.debug:1 rc:perf.rc export >/dev/null 2>&1 +../src/task rc.debug:1 rc:perf.rc export 2>&1 >export.json | grep "Perf task" + +echo ' - task import...' +rm -f ./pending.data ./completed.data ./undo.data ./backlog.data +../src/task rc.debug:1 rc:perf.rc import export.json 2>&1 | grep "Perf task" + echo 'End' exit 0 diff --git a/scripts/add-ons/export-csv.pl b/scripts/add-ons/export-csv.pl index 334dc9d71..69ceab935 100755 --- a/scripts/add-ons/export-csv.pl +++ b/scripts/add-ons/export-csv.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-html.pl b/scripts/add-ons/export-html.pl index 4e558f9a2..03afaeb4c 100755 --- a/scripts/add-ons/export-html.pl +++ b/scripts/add-ons/export-html.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-ical.pl b/scripts/add-ons/export-ical.pl index 7fc84ea44..9eeadcfa0 100755 --- a/scripts/add-ons/export-ical.pl +++ b/scripts/add-ons/export-ical.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-sql.py b/scripts/add-ons/export-sql.py index 4bdb01d25..206dfd96f 100755 --- a/scripts/add-ons/export-sql.py +++ b/scripts/add-ons/export-sql.py @@ -2,7 +2,7 @@ ############################################################################### # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-tsv.pl b/scripts/add-ons/export-tsv.pl index b4a4dd262..f4e079b4a 100755 --- a/scripts/add-ons/export-tsv.pl +++ b/scripts/add-ons/export-tsv.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-xml.pl b/scripts/add-ons/export-xml.pl index 61c08687f..7e28f0af3 100755 --- a/scripts/add-ons/export-xml.pl +++ b/scripts/add-ons/export-xml.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-xml.py b/scripts/add-ons/export-xml.py index c7855df49..813003b54 100755 --- a/scripts/add-ons/export-xml.py +++ b/scripts/add-ons/export-xml.py @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-xml.rb b/scripts/add-ons/export-xml.rb index b432f3215..034cfdfa3 100755 --- a/scripts/add-ons/export-xml.rb +++ b/scripts/add-ons/export-xml.rb @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-yad.pl b/scripts/add-ons/export-yad.pl index 27e924dc1..f080b8efc 100755 --- a/scripts/add-ons/export-yad.pl +++ b/scripts/add-ons/export-yad.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/export-yaml.pl b/scripts/add-ons/export-yaml.pl index e4d7a2e97..84f353e3b 100755 --- a/scripts/add-ons/export-yaml.pl +++ b/scripts/add-ons/export-yaml.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/import-todo.sh.pl b/scripts/add-ons/import-todo.sh.pl index 39ab2a460..d050b9db0 100755 --- a/scripts/add-ons/import-todo.sh.pl +++ b/scripts/add-ons/import-todo.sh.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/import-yaml.pl b/scripts/add-ons/import-yaml.pl index de1bbdf23..4b5b13746 100755 --- a/scripts/add-ons/import-yaml.pl +++ b/scripts/add-ons/import-yaml.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/scripts/add-ons/update-holidays.pl b/scripts/add-ons/update-holidays.pl index eb9f1ee93..4b0f2e5ee 100755 --- a/scripts/add-ons/update-holidays.pl +++ b/scripts/add-ons/update-holidays.pl @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -190,7 +190,7 @@ if (open my $fh, '>:utf8', $file) "# ${url_current}\n", "# ${url_next}\n", "#\n", - "# Copyright 2006-2013, Paul Beckingham, Federico Hernandez.\n", + "# Copyright 2006-2014, Paul Beckingham, Federico Hernandez.\n", "#\n", "# Permission is hereby granted, free of charge, to any person obtaining a copy\n", "# of this software and associated documentation files (the \"Software\"), to deal\n", diff --git a/scripts/bash/task.sh b/scripts/bash/task.sh index f67abb59a..23986f4d9 100644 --- a/scripts/bash/task.sh +++ b/scripts/bash/task.sh @@ -2,7 +2,7 @@ # bash completion support for taskwarrior # taskwarrior - a command line task list manager. # -# Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +# Copyright 2006-2014, 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 diff --git a/scripts/fish/task.fish b/scripts/fish/task.fish index d56e05887..c5192e5e0 100644 --- a/scripts/fish/task.fish +++ b/scripts/fish/task.fish @@ -12,7 +12,7 @@ # * Tags # * Attribute names and modifiers # -# Copyright 2009 - 2013 Mick Koch +# Copyright 2009 - 2014 Mick Koch # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/scripts/utils/l10n b/scripts/utils/l10n new file mode 100755 index 000000000..da9769267 --- /dev/null +++ b/scripts/utils/l10n @@ -0,0 +1,172 @@ +#! /usr/bin/env python -tt +################################################################################ +## taskwarrior - a command line task list manager. +## +## Copyright 2006-2014, 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 +## +################################################################################ + +from __future__ import print_function +from __future__ import unicode_literals + +import os +import sys +import argparse +import re +import fnmatch + +def find_localizations(source): + '''Finds all [a-z][a-z]-[A-Z][A-Z].h files in the source tree.''' + found = [] + for path, dirs, files in os.walk(source, topdown=True, onerror=None, followlinks=False): + found.extend(map(lambda x: os.path.join(path, x), + fnmatch.filter(files, '[a-z][a-z]-[A-Z][A-Z].h'))) + return found + +def read_file(translations, file): + '''Reads all the localized strings from a file.''' + translations[file] = {} + with open(file, 'r') as fh: + for match in re.findall(r'^\s*#define\s+(STRING_[^\s]+)(\s|\\)+"([^"]*)"', fh.read(), re.MULTILINE): + translations[file][match[0]] = match[2] + +def is_present(translations, file, string): + '''Determines if the string is defined in a translation.''' + return string in translations[file] + +def used_in_source(source, string): + '''Determines if the string is used in the source.''' + command = "git grep %s %s | grep -v [a-z][a-z]-[A-Z][A-Z].h >/dev/null 2>&1" % (string, source) + return True if os.system(command) == 0 else False + +def is_translated(translations, file, string): + '''Determines whether the string is the same in the base version as in the + translation, indicating work needed.''' + if file == base: + return True + elif string not in translations[base]: + return True + elif string not in translations[file]: + return False + else: + return bool(translations[file][string] != translations[base][string]) + +def main(args): + '''Processes all the localized files.''' + errors = 0 + translations = {} + + for file in args.files: + # Verify all files exist. + if not os.path.exists(file): + raise Exception("Localized file '%s' not readable." % file) + read_file(translations, file) + + strings = set() + for file in translations: + for string in translations[file]: + strings.add(string) + + if len(strings) == 0: + if not args.quiet: + print("There are no localized strings found.") + errors = 1 + + # Get length of longest string ID. + longest_string = len(max(strings, key=len)) + + # Display info. + if not args.quiet: + print('Scanning in', args.source) + print() + + # Print header line. + files = map(lambda x: os.path.basename(x), args.files) + if not args.quiet: + print('%-*s %s' % (longest_string, 'String ID', ' '.join(files))) + print('-' * longest_string, ' '.join(['-------'] * len(files))) + + for string in sorted(strings): + # assess status of 'string': + # - clean + + line = '' + line_errors = 0 + for file in args.files: + message = ' ' + if is_present(translations, file, string): + if is_translated(translations, file, string): + message = ' Ok ' + else: + message = ' TODO ' + else: + message = ' Missing' + line_errors = 1 + + line += message + + if args.all or line_errors != 0: + if args.search: + if used_in_source(args.source, string): + if not args.quiet: + print('%-*s' % (longest_string, string), line, sep='') + else: + if not args.quiet: + print('%-*s' % (longest_string, string), line, sep='') + line_errors = 1 + else: + if not args.quiet: + print('%-*s' % (longest_string, string), line, sep='') + + if line_errors: + errors = 1 + + if not args.quiet: + print('-' * longest_string, ' '.join(['-------'] * len(files))) + print('%-*s' % (longest_string, 'Total'), end='') + for file in args.files: + print('%8d' % len(translations[file]), end='') + print() + + sys.exit(errors) + +if __name__ == "__main__": + usage="""Utility for checking localized string status across translations.""" + + parser = argparse.ArgumentParser(description=usage) + parser.add_argument('--source', action='store', required=True, help='The source code tree.') + parser.add_argument('--all', action='store_true', help='Show all string IDs.') + parser.add_argument('--search', action='store_true', help='Search source for use.') + parser.add_argument('--quiet', action='store_true', help='Produces no output.') + args = parser.parse_args() + + if args.source: + args.files = find_localizations(args.source) + + base = filter(lambda x: x.endswith('en-US.h'), args.files)[0] + + try: + main(args) + except Exception as msg: + print('Error:', msg) + diff --git a/scripts/utils/verify_l10n b/scripts/utils/verify_l10n deleted file mode 100755 index a148e36c2..000000000 --- a/scripts/utils/verify_l10n +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -################################################################################ -## taskwarrior - a command line task list manager. -## -## Copyright 2006-2013, 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 -## -################################################################################ - -import sys -import re - -if len(sys.argv) < 3: - print "Usage:", sys.argv[0], "file1 file2 ..." - sys.exit() - -translations = {} -missing = {} -for file in sys.argv[1:]: - with open(file, 'r') as f: - translations[file] = set() - missing[file] = set() - # Treat empty strings ("") as a missing entry - because they are just that. - for m in re.findall(r'^\s*#define\s(STRING_[^\s]+)(\s|\\)+"([^"]+)"', f.read(), re.MULTILINE): - translations[file].add(m[0]) - -for file in translations: - for entry in translations[file]: - for other_translation in translations: - if entry not in translations[other_translation]: - missing[other_translation].add(entry) - -for file in missing: - if len(missing[file]) > 0: - print "--- %s --- missing defines:" % file - for i in sorted(list(missing[file])): - print i - else: - print "--- %s --- is ok." % file - diff --git a/scripts/vim/README b/scripts/vim/README index 7064e0b95..e1d58f744 100644 --- a/scripts/vim/README +++ b/scripts/vim/README @@ -53,7 +53,7 @@ You should then be ready to go. --- All four above mentioned files are -Copyright 2009 - 2013 John Florian +Copyright 2009 - 2014 John Florian and are available under the MIT license. For the full text of this license, see COPYING. diff --git a/scripts/vim/ftdetect/task.vim b/scripts/vim/ftdetect/task.vim index 2a7b262cd..0146224e5 100644 --- a/scripts/vim/ftdetect/task.vim +++ b/scripts/vim/ftdetect/task.vim @@ -4,7 +4,7 @@ " Maintainer: John Florian " Updated: Thu Dec 10 18:28:26 EST 2009 " -" Copyright 2009 - 2013 John Florian +" Copyright 2009 - 2014 John Florian " " This file is available under the MIT license. " For the full text of this license, see COPYING. diff --git a/scripts/vim/syntax/taskdata.vim b/scripts/vim/syntax/taskdata.vim index a8ef487e7..73fdb131e 100644 --- a/scripts/vim/syntax/taskdata.vim +++ b/scripts/vim/syntax/taskdata.vim @@ -3,7 +3,7 @@ " Maintainer: John Florian " Updated: Wed Jul 8 19:46:20 EDT 2009 " -" Copyright 2009 - 2013 John Florian +" Copyright 2009 - 2014 John Florian " " This file is available under the MIT license. " For the full text of this license, see COPYING. diff --git a/scripts/vim/syntax/taskedit.vim b/scripts/vim/syntax/taskedit.vim index 19a91ed22..d53a30b9e 100644 --- a/scripts/vim/syntax/taskedit.vim +++ b/scripts/vim/syntax/taskedit.vim @@ -3,7 +3,7 @@ " Maintainer: John Florian " Updated: Wed Jul 8 19:46:32 EDT 2009 " -" Copyright 2009 - 2013 John Florian +" Copyright 2009 - 2014 John Florian " " This file is available under the MIT license. " For the full text of this license, see COPYING. diff --git a/scripts/vim/syntax/taskrc.vim b/scripts/vim/syntax/taskrc.vim index bdd99e67b..347023ef9 100644 --- a/scripts/vim/syntax/taskrc.vim +++ b/scripts/vim/syntax/taskrc.vim @@ -3,7 +3,7 @@ " Maintainer: John Florian " Updated: Sat Feb 20 14:14:44 EST 2010 " -" Copyright 2009 - 2013 John Florian +" Copyright 2009 - 2014 John Florian " " This file is available under the MIT license. " For the full text of this license, see COPYING. diff --git a/scripts/zsh/_task b/scripts/zsh/_task index 2668449fe..13651937b 100644 --- a/scripts/zsh/_task +++ b/scripts/zsh/_task @@ -3,7 +3,7 @@ # # taskwarrior - a command line task list manager. # -# Copyright 2010 - 2013 Johannes Schlatow +# Copyright 2010 - 2014 Johannes Schlatow # Copyright 2009 P.C. Shyamshankar # # Permission is hereby granted, free of charge, to any person obtaining a copy @@ -98,11 +98,13 @@ _regex_words values 'task dates' \ 'soww:Start of work week' \ 'socw:Start of calendar week' \ 'som:Start of month' \ + 'soq:Start of quarter' \ 'soy:Start of year' \ 'eow:End of week' \ 'eoww:End of work week' \ 'eocw:End of calendar week' \ 'eom:End of month' \ + 'eoq:End of quarter' \ 'eoy:End of year' \ 'mon:Monday' \ 'tue:Tuesday'\ @@ -110,7 +112,16 @@ _regex_words values 'task dates' \ 'thu:Thursday' \ 'fri:Friday' \ 'sat:Saturday' \ - 'sun:Sunday' + 'sun:Sunday' \ + 'good*friday:Good Friday' \ + 'easter:Easter' \ + 'eastermonday:Easter Monday' \ + 'ascension:Ascension' \ + 'pentecost:Pentecost' \ + 'midsommar:Midsommar' \ + 'midsommarafton:Midsommarafton' \ + 'later:Later' \ + 'someday:Some Day' _task_dates=("$reply[@]") local -a _task_reldates @@ -141,7 +152,7 @@ _regex_words values 'task frequencies' \ 'weekly:Every week' \ 'biweekly:Every two weeks' \ 'fortnight:Every two weeks' \ - 'monthly:Every month' \ + 'monthly:Every month' \ 'quarterly:Every three months' \ 'semiannual:Every six months' \ 'annual:Every year' \ diff --git a/src/A3.cpp b/src/A3.cpp index cd439f83f..a41871770 100644 --- a/src/A3.cpp +++ b/src/A3.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -39,7 +40,6 @@ #include #include #include -#include #ifdef FEATURE_STDIN #include @@ -72,38 +72,37 @@ static struct std::string op; int precedence; char type; - int symbol; char associativity; } operators[] = { - // Operator Precedence Type Symbol Associativity - { "and", 5, 'b', 0, 'l' }, // Conjunction - { "xor", 4, 'b', 0, 'l' }, // Disjunction + // Operator Precedence Type Associativity + { "and", 5, 'b', 'l' }, // Conjunction + { "xor", 4, 'b', 'l' }, // Disjunction - { "or", 3, 'b', 0, 'l' }, // Disjunction - { "<=", 10, 'b', 1, 'l' }, // Less than or equal - { ">=", 10, 'b', 1, 'l' }, // Greater than or equal - { "!~", 9, 'b', 1, 'l' }, // Regex non-match - { "!=", 9, 'b', 1, 'l' }, // Inequal + { "or", 3, 'b', 'l' }, // Disjunction + { "<=", 10, 'b', 'l' }, // Less than or equal + { ">=", 10, 'b', 'l' }, // Greater than or equal + { "!~", 9, 'b', 'l' }, // Regex non-match + { "!=", 9, 'b', 'l' }, // Inequal - { "=", 9, 'b', 1, 'l' }, // Equal -// { "^", 16, 'b', 1, 'r' }, // Exponent - { ">", 10, 'b', 1, 'l' }, // Greater than - { "~", 9, 'b', 1, 'l' }, // Regex match - { "!", 15, 'u', 1, 'r' }, // Not + { "=", 9, 'b', 'l' }, // Equal +// { "^", 16, 'b', 'r' }, // Exponent + { ">", 10, 'b', 'l' }, // Greater than + { "~", 9, 'b', 'l' }, // Regex match + { "!", 15, 'u', 'r' }, // Not - { "_hastag_", 9, 'b', 0, 'l'}, // +tag [Pseudo-op] - { "_notag_", 9, 'b', 0, 'l'}, // -tag [Pseudo-op] + { "_hastag_", 9, 'b', 'l'}, // +tag [Pseudo-op] + { "_notag_", 9, 'b', 'l'}, // -tag [Pseudo-op] - { "-", 15, 'u', 1, 'r' }, // Unary minus - { "*", 13, 'b', 1, 'l' }, // Multiplication - { "/", 13, 'b', 1, 'l' }, // Division -// { "%", 13, 'b', 1, 'l' }, // Modulus - { "+", 12, 'b', 1, 'l' }, // Addition - { "-", 12, 'b', 1, 'l' }, // Subtraction - { "<", 10, 'b', 1, 'l' }, // Less than - { "(", 0, 'b', 1, 'l' }, // Precedence start - { ")", 0, 'b', 1, 'l' }, // Precedence end + { "-", 15, 'u', 'r' }, // Unary minus + { "*", 13, 'b', 'l' }, // Multiplication + { "/", 13, 'b', 'l' }, // Division +// { "%", 13, 'b', 'l' }, // Modulus + { "+", 12, 'b', 'l' }, // Addition + { "-", 12, 'b', 'l' }, // Subtraction + { "<", 10, 'b', 'l' }, // Less than + { "(", 0, 'b', 'l' }, // Precedence start + { ")", 0, 'b', 'l' }, // Precedence end }; #define NUM_MODIFIER_NAMES (sizeof (modifierNames) / sizeof (modifierNames[0])) @@ -1141,6 +1140,9 @@ const A3 A3::sequence (const A3& input) const if (ids.size () == 0 && uuids.size () == 0) return input; + if (ids.size () == 1 && ids[0] < 1) + throw format (STRING_A3_ZERO_ID, ids[0]); + // Copy everything up to the first id/uuid. for (arg = input.begin (); arg != input.end (); ++arg) { @@ -1371,7 +1373,6 @@ bool A3::is_attmod (Nibbler& n, Arg& arg) std::string canonical; std::string modifier; std::string value; -// time_t date; // If there is a valid attribute name. if (n.getName (name) && @@ -1403,14 +1404,6 @@ bool A3::is_attmod (Nibbler& n, Arg& arg) n.getUntilEOS (value) || // Redundant? n.depleted ()) { -/* - TODO Eliminate anything that looks like a URL. - // Exclude certain URLs, that look like attrs. - if (value.find ('@') <= n.cursor () || - value.find ('/') <= n.cursor ()) - return false; -*/ - arg._raw = canonical + '.' + modifier + ':' + value; Column* col = context.columns[canonical]; arg._type = col ? Arg::type_id (col->type ()) : Arg::type_pseudo; @@ -1575,6 +1568,7 @@ bool A3::is_dom (Nibbler& n, Arg& arg) //////////////////////////////////////////////////////////////////////////////// bool A3::is_date (Nibbler& n, std::string& result) { +#ifdef NIBBLER_FEATURE_DATE std::string date_format = context.config.get ("dateformat"); std::string::size_type start = n.save (); time_t t; @@ -1586,6 +1580,7 @@ bool A3::is_date (Nibbler& n, std::string& result) } n.restore (); +#endif return false; } diff --git a/src/A3.h b/src/A3.h index 366ed5620..2c8059f84 100644 --- a/src/A3.h +++ b/src/A3.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/Arg.cpp b/src/Arg.cpp index 619f2c126..799a367bf 100644 --- a/src/Arg.cpp +++ b/src/Arg.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include diff --git a/src/Arg.h b/src/Arg.h index 39002573f..999cc7775 100644 --- a/src/Arg.h +++ b/src/Arg.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a16bacf69..906a304bc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,6 +33,7 @@ set (task_SRCS A3.cpp A3.h Task.cpp Task.h Taskmod.cpp Taskmod.h Timer.cpp Timer.h + TLSClient.cpp TLSClient.h Transport.cpp Transport.h TransportCurl.cpp TransportCurl.h TransportRSYNC.cpp TransportRSYNC.h diff --git a/src/Color.cpp b/src/Color.cpp index 7ddf89128..7758fd06a 100644 --- a/src/Color.cpp +++ b/src/Color.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/Color.h b/src/Color.h index 7d4e90b87..b76418447 100644 --- a/src/Color.h +++ b/src/Color.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -30,6 +30,8 @@ #include +#define FEATURE_COLOR 1 + //////////////////////////////////////////////////////////////////////////////// #define _COLOR_INVERSE 0x00400000 // Inverse attribute. #define _COLOR_256 0x00200000 // 256-color mode. diff --git a/src/Config.cpp b/src/Config.cpp index f327980bf..a32400c67 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -37,10 +38,10 @@ #include #include #include +#include #include #include #include -#include #include //////////////////////////////////////////////////////////////////////////////// @@ -290,17 +291,17 @@ std::string Config::_defaults = "list.all.tags=no # Include old tag names in 'tags' command\n" "print.empty.columns=no # Print columns which have no data for any task\n" "debug=no # Display diagnostics\n" + "debug.tls=0 # GnuTLS log level\n" "extensions=off # Extension system master switch\n" "fontunderline=yes # Uses underlines rather than -------\n" "shell.prompt=task> # Prompt used by the shell command\n" "\n" - "# Merge options\n" - "#\n" - "# WARNING: Please read the documentation (man task-sync) before proceeding with these\n" - "# synchronization features. If improperly used, data can be lost!\n" - "merge.autopush=ask # Push database to remote origin after merge: yes, no, ask\n" - "#merge.default.uri=user@host.xz:.task/ # URI for merge\n" - "#pull.default.uri=rsync://host.xz/task-backup/ # URI for pull\n" + "# WARNING: Please read the documentation (man task-sync) before setting up\n" + "# Taskwarrior for Taskserver synchronization.\n" + "#taskd.certificate \n" + "#taskd.credentials //\n" + "#taskd.server :\n" + "taskd.ciphers=NORMAL\n" "\n" "# Aliases - alternate names for commands\n" "alias.rm=delete # Alias for the delete command\n" @@ -308,6 +309,7 @@ std::string Config::_defaults = "alias.ghistory=ghistory.monthly # Prefer monthly graphical over annual history reports\n" "alias._query=export # _query is now export\n" "alias.burndown=burndown.weekly # Prefer the weekly burndown chart\n" + "alias.shell=exec tasksh # Alias old shell command to new shell\n" "\n" "# Reports\n" "\n" @@ -377,7 +379,6 @@ std::string Config::_defaults = "report.waiting.filter=+WAITING\n" "report.waiting.sort=due+,wait+,entry+\n" "\n" - // Updated. "report.all.description=Pending, waiting and completed tasks by age\n" "report.all.labels=ID,St,UUID,A,Age,Done,D,P,Project,Tags,R,Wait,Sch,Due,Until,Description\n" "report.all.columns=id,status.short,uuid.short,start.active,entry.age,end.age,depends.indicator,priority,project.parent,tags.count,recur.indicator,wait.age,scheduled.age,due,until.age,description\n" @@ -496,7 +497,7 @@ void Config::parse (const std::string& input, int nest /* = 1 */) std::string key = trim (line.substr (0, equal), " \t"); // no i18n std::string value = trim (line.substr (equal+1, line.length () - equal), " \t"); // no i18n - (*this)[key] = value; + (*this)[key] = json::decode (value); } else { diff --git a/src/Config.h b/src/Config.h index 4ddf5983f..a546d79d2 100644 --- a/src/Config.h +++ b/src/Config.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006 - 2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2014, 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 diff --git a/src/Context.cpp b/src/Context.cpp index c44e51576..4937627a4 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #ifdef HAVE_COMMIT #include #endif @@ -152,10 +152,6 @@ int Context::initialize (int argc, const char** argv) // Apply rc overrides to Context::config, capturing raw args for later use. a3.apply_overrides (); - // Now that the final RC is in place, initialize the urgency coefficients - // to speed the 'next' report. - initializeUrgencyCoefficients (); - // Initialize the color rules, if necessary. if (color ()) initializeColorRules (); @@ -166,6 +162,9 @@ int Context::initialize (int argc, const char** argv) // Instantiate built-in column objects. Column::factory (columns); + // Static initialization to decouple code. + staticInitialization (); + // Categorize all arguments one more time. THIS IS NECESSARY - it helps the // following inject_defaults method determine whether there needs to be a // default command assumed. @@ -597,6 +596,48 @@ const std::vector Context::getCommands () const return output; } +//////////////////////////////////////////////////////////////////////////////// +// The 'Task' object, among others, is shared between projects. To make this +// easier, it has been decoupled from Context. +void Context::staticInitialization () +{ + Task::defaultProject = config.get ("default.project"); + Task::defaultPriority = config.get ("default.priority"); + Task::defaultDue = config.get ("default.due"); + Task::searchCaseSensitive = config.getBoolean ("search.case.sensitive"); + Task::regex = config.getBoolean ("regex"); + + std::map ::iterator i; + for (i = columns.begin (); i != columns.end (); ++i) + Task::attributes[i->first] = i->second->type (); + + Task::urgencyPriorityCoefficient = config.getReal ("urgency.priority.coefficient"); + Task::urgencyProjectCoefficient = config.getReal ("urgency.project.coefficient"); + Task::urgencyActiveCoefficient = config.getReal ("urgency.active.coefficient"); + Task::urgencyScheduledCoefficient = config.getReal ("urgency.scheduled.coefficient"); + Task::urgencyWaitingCoefficient = config.getReal ("urgency.waiting.coefficient"); + Task::urgencyBlockedCoefficient = config.getReal ("urgency.blocked.coefficient"); + Task::urgencyAnnotationsCoefficient = config.getReal ("urgency.annotations.coefficient"); + Task::urgencyTagsCoefficient = config.getReal ("urgency.tags.coefficient"); + Task::urgencyNextCoefficient = config.getReal ("urgency.next.coefficient"); + Task::urgencyDueCoefficient = config.getReal ("urgency.due.coefficient"); + Task::urgencyBlockingCoefficient = config.getReal ("urgency.blocking.coefficient"); + Task::urgencyAgeCoefficient = config.getReal ("urgency.age.coefficient"); + Task::urgencyAgeMax = config.getReal ("urgency.age.max"); + + // Tag- and project-specific coefficients. + std::vector all; + config.all (all); + + std::vector ::iterator var; + for (var = all.begin (); var != all.end (); ++var) + { + if (var->substr (0, 13) == "urgency.user." || + var->substr (0, 12) == "urgency.uda.") + Task::coefficients[*var] = config.getReal (*var); + } +} + //////////////////////////////////////////////////////////////////////////////// void Context::assumeLocations () { diff --git a/src/Context.h b/src/Context.h index 01f9a32e9..517d2021b 100644 --- a/src/Context.h +++ b/src/Context.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -75,6 +75,7 @@ public: void decomposeSortField (const std::string&, std::string&, bool&); private: + void staticInitialization (); void assumeLocations (); void createDefaultConfig (); void loadAliases (); diff --git a/src/DOM.cpp b/src/DOM.cpp index 776a2ffdd..625b51f42 100644 --- a/src/DOM.cpp +++ b/src/DOM.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,13 +25,13 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include #include #include #include -#include extern Context context; @@ -73,6 +73,7 @@ const std::vector DOM::get_references () const // // system.version // system.os +// const std::string DOM::get (const std::string& name) { int len = name.length (); @@ -86,20 +87,20 @@ const std::string DOM::get (const std::string& name) } // context.* - else if (len > 8 && + if (len > 8 && name.substr (0, 8) == "context.") { if (name == "context.program") return context.a3[0]._raw; else if (name == "context.args") return context.a3.combine (); - else if (name == "context.width") return format (context.terminal_width); - else if (name == "context.height") return format (context.terminal_height); + else if (name == "context.width") return format (context.terminal_width ? context.terminal_width : context.getWidth ()); + else if (name == "context.height") return format (context.terminal_height ? context.terminal_height : context.getHeight ()); else throw format (STRING_DOM_UNREC, name); } // TODO stats. // system. --> Implement locally. - else if (len > 7 && + if (len > 7 && name.substr (0, 7) == "system.") { // Taskwarrior version number. @@ -143,53 +144,26 @@ const std::string DOM::get (const std::string& name) //////////////////////////////////////////////////////////////////////////////// // DOM Supported References: // -// TODO .{entry,start,end,scheduled,due,until,wait} -// TODO .description -// TODO .project -// TODO .priority -// TODO .parent -// TODO .status -// TODO .tags -// TODO .urgency -// TODO .recur -// TODO .depends -// -// TODO .{entry,start,end,scheduled,due,until,wait} -// TODO .description -// TODO .project -// TODO .priority -// TODO .parent -// TODO .status -// TODO .tags -// TODO .urgency -// TODO .recur -// TODO .depends -// -// {entry,start,end,scheduled,due,until,wait} -// description -// project -// priority -// parent -// status -// tags -// urgency -// recur -// depends +// +// . +// . // const std::string DOM::get (const std::string& name, const Task& task) { Nibbler n (name); + n.save (); + int id; std::string uuid; std::string canonical; // if (name == "id") return format (task.id); - else if (name == "urgency") return format (task.urgency_c (), 4, 3); + else if (name == "urgency") return format (task.urgency_c ()); else if (A3::is_attribute (name, canonical)) return task.get (canonical); // . - else if (n.getInt (id)) + if (n.getInt (id)) { if (n.skip ('.')) { @@ -203,13 +177,15 @@ const std::string DOM::get (const std::string& name, const Task& task) n.getUntilEOS (attr); if (attr == "id") return format (ref.id); - else if (attr == "urgency") return format (ref.urgency_c (), 4, 3); + else if (attr == "urgency") return format (ref.urgency_c ()); else if (A3::is_attribute (attr, canonical)) return ref.get (canonical); } + + n.restore (); } // . - else if (n.getUUID (uuid)) + if (n.getUUID (uuid)) { if (n.skip ('.')) { @@ -222,10 +198,12 @@ const std::string DOM::get (const std::string& name, const Task& task) std::string attr; n.getUntilEOS (attr); - if (name == "id") return format (ref.id); - else if (name == "urgency") return format (ref.urgency_c (), 4, 3); + if (attr == "id") return format (ref.id); + else if (attr == "urgency") return format (ref.urgency_c (), 4, 3); else if (A3::is_attribute (attr, canonical)) return ref.get (canonical); } + + n.restore (); } // Delegate to the context-free version of DOM::get. diff --git a/src/DOM.h b/src/DOM.h index 0702b042e..7cfcce379 100644 --- a/src/DOM.h +++ b/src/DOM.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/Date.cpp b/src/Date.cpp index 29aaff2eb..6e071e2ed 100644 --- a/src/Date.cpp +++ b/src/Date.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -133,8 +134,10 @@ Date::Date (const std::string& input, const std::string& format /* = "m/d/Y" */) // Parse a formatted date. Nibbler n (input); +#ifdef NIBBLER_FEATURE_DATE if (n.getDate (format, _t) && n.depleted ()) return; +#endif // Parse an ISO date. if (n.getDateISO (_t) && n.depleted ()) @@ -582,6 +585,12 @@ int Date::month () const return t->tm_mon + 1; } +//////////////////////////////////////////////////////////////////////////////// +int Date::week () const +{ + return Date::weekOfYear (Date::dayOfWeek (context.config.get ("weekstart"))); +} + //////////////////////////////////////////////////////////////////////////////// int Date::day () const { @@ -676,6 +685,16 @@ bool Date::sameDay (const Date& rhs) const return false; } +//////////////////////////////////////////////////////////////////////////////// +bool Date::sameWeek (const Date& rhs) const +{ + if (this->year () == rhs.year () && + this->week () == rhs.week ()) + return true; + + return false; +} + //////////////////////////////////////////////////////////////////////////////// bool Date::sameMonth (const Date& rhs) const { @@ -834,8 +853,7 @@ bool Date::isRelativeDate (const std::string& input) found == "eoww" || found == "eocw" || found == "sow" || - found == "soww" || - found == "socw") + found == "soww") { if (found == "eow" || found == "eoww") dow = 5; @@ -846,9 +864,6 @@ bool Date::isRelativeDate (const std::string& input) if (found == "sow" || found == "soww") dow = 1; - if (found == "socw") - dow = Date::dayOfWeek (context.config.get ("weekstart")); - if (today.dayOfWeek () >= dow) today += (dow - today.dayOfWeek () + 7) * 86400; else @@ -861,6 +876,28 @@ bool Date::isRelativeDate (const std::string& input) _t = then._t; return true; } + + else if (found == "socw") + { + // day S M T W T F S + // dow 0 1 2 3 4 5 6 + // ----------------------- + // weekstart ^ + // today1 ^ + // today2 ^ + // + // delta1 = 6 <-- (0 - 1 + 7) % 7 + // delta2 = 3 <-- (4 - 1 + 7) % 7 + + dow = Date::dayOfWeek (context.config.get ("weekstart")); + int delta = (today.dayOfWeek () - dow + 7) % 7; + today -= delta * 86400; + + Date then (today.month (), today.day (), today.year ()); + _t = then._t; + return true; + } + else if (found == "today") { Date then (today.month (), diff --git a/src/Date.h b/src/Date.h index 4bd0342f8..97919030f 100644 --- a/src/Date.h +++ b/src/Date.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -29,9 +29,9 @@ #define INCLUDED_DATE #include +#include #include - class Date; class Date @@ -76,6 +76,7 @@ public: static int length (const std::string&); int month () const; + int week () const; int day () const; int year () const; int weekOfYear (int) const; @@ -93,6 +94,7 @@ public: bool operator>= (const Date&) const; bool sameHour (const Date&) const; bool sameDay (const Date&) const; + bool sameWeek (const Date&) const; bool sameMonth (const Date&) const; bool sameYear (const Date&) const; diff --git a/src/Directory.cpp b/src/Directory.cpp index b666d11b3..e89aa5df0 100644 --- a/src/Directory.cpp +++ b/src/Directory.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #ifdef SOLARIS #include @@ -85,19 +85,19 @@ Directory& Directory::operator= (const Directory& other) } //////////////////////////////////////////////////////////////////////////////// -bool Directory::create () +bool Directory::create (int mode /* = 0755 */) { - return mkdir (_data.c_str (), 0755) == 0 ? true : false; + return mkdir (_data.c_str (), mode) == 0 ? true : false; } //////////////////////////////////////////////////////////////////////////////// -bool Directory::remove () +bool Directory::remove () const { return remove_directory (_data); } //////////////////////////////////////////////////////////////////////////////// -bool Directory::remove_directory (const std::string& dir) +bool Directory::remove_directory (const std::string& dir) const { DIR* dp = opendir (dir.c_str ()); if (dp != NULL) @@ -191,6 +191,12 @@ bool Directory::up () return false; } +//////////////////////////////////////////////////////////////////////////////// +bool Directory::cd () const +{ + return chdir (_data.c_str ()) == 0 ? true : false; +} + //////////////////////////////////////////////////////////////////////////////// void Directory::list ( const std::string& base, diff --git a/src/Directory.h b/src/Directory.h index dd03c21ad..988d15fee 100644 --- a/src/Directory.h +++ b/src/Directory.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -42,18 +42,19 @@ public: Directory& operator= (const Directory&); - virtual bool create (); - virtual bool remove (); + virtual bool create (int mode = 0755); + virtual bool remove () const; std::vector list (); std::vector listRecursive (); static std::string cwd (); bool up (); + bool cd () const; private: void list (const std::string&, std::vector &, bool); - bool remove_directory (const std::string&); + bool remove_directory (const std::string&) const; }; #endif diff --git a/src/E9.cpp b/src/E9.cpp index b8f8de89e..9cf841acb 100644 --- a/src/E9.cpp +++ b/src/E9.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,8 @@ // //////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include #include @@ -183,7 +185,10 @@ void E9::eval (const Task& task, std::vector & value_stack) { OldDuration dur (operand._raw); Date now; - now += (int)(time_t) dur; + if (dur.negative ()) + now -= (int)(time_t) dur; + else + now += (int)(time_t) dur; operand._value = now.toEpochString (); } else diff --git a/src/E9.h b/src/E9.h index 5f73ff4cb..19a33fb25 100644 --- a/src/E9.h +++ b/src/E9.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/File.cpp b/src/File.cpp index e44a8d730..48c22a241 100644 --- a/src/File.cpp +++ b/src/File.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,8 +25,10 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include +#include #include #include #include @@ -89,10 +91,11 @@ File& File::operator= (const File& other) } //////////////////////////////////////////////////////////////////////////////// -bool File::create () +bool File::create (int mode /* = 0640 */) { if (open ()) { + fchmod (_h, mode); close (); return true; } @@ -101,7 +104,7 @@ bool File::create () } //////////////////////////////////////////////////////////////////////////////// -bool File::remove () +bool File::remove () const { return unlink (_data.c_str ()) == 0 ? true : false; } @@ -193,12 +196,13 @@ bool File::waitForLock () void File::read (std::string& contents) { contents = ""; + contents.reserve (size ()); std::ifstream in (_data.c_str ()); if (in.good ()) { std::string line; - line.reserve (1024); + line.reserve (512 * 1024); while (getline (in, line)) contents += line + "\n"; @@ -216,7 +220,7 @@ void File::read (std::vector & contents) if (in.good ()) { std::string line; - line.reserve (1024); + line.reserve (512 * 1024); while (getline (in, line)) contents.push_back (line); @@ -336,12 +340,38 @@ time_t File::mtime () const } //////////////////////////////////////////////////////////////////////////////// -bool File::create (const std::string& name) +time_t File::ctime () const { - std::ofstream out (expand (name).c_str ()); + struct stat s; + if (!stat (_data.c_str (), &s)) + return s.st_ctime; + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +time_t File::btime () const +{ + struct stat s; + if (!stat (_data.c_str (), &s)) +#ifdef HAVE_ST_BIRTHTIME + return s.st_birthtime; +#else + return s.st_ctime; +#endif + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +bool File::create (const std::string& name, int mode /* = 0640 */) +{ + std::string full_name = expand (name); + std::ofstream out (full_name.c_str ()); if (out.good ()) { out.close (); + chmod (full_name.c_str (), mode); return true; } diff --git a/src/File.h b/src/File.h index d6d7b4c49..688a7bb4c 100644 --- a/src/File.h +++ b/src/File.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -45,8 +45,8 @@ public: File& operator= (const File&); - virtual bool create (); - virtual bool remove (); + virtual bool create (int mode = 0640); + virtual bool remove () const; bool open (); bool openAndLock (); @@ -69,8 +69,10 @@ public: virtual mode_t mode (); virtual size_t size () const; virtual time_t mtime () const; + virtual time_t ctime () const; + virtual time_t btime () const; - static bool create (const std::string&); + static bool create (const std::string&, int mode = 0640); static std::string read (const std::string&); static bool read (const std::string&, std::string&); static bool read (const std::string&, std::vector &); diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 9358e2307..a5da7d9db 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -105,25 +106,21 @@ void Hooks::initialize () bool big_red_switch = context.config.getBoolean ("extensions"); if (big_red_switch) { - std::vector vars; - context.config.all (vars); - - std::vector ::iterator it; - for (it = vars.begin (); it != vars.end (); ++it) + Config::const_iterator it; + for (it = context.config.begin (); it != context.config.end (); ++it) { std::string type; std::string name; std::string value; // "." - Nibbler n (*it); + Nibbler n (it->first); if (n.getUntil ('.', type) && type == "hook" && n.skip ('.') && n.getUntilEOS (name)) { - std::string value = context.config.get (*it); - Nibbler n (value); + Nibbler n (it->second); // : [, ...] while (!n.depleted ()) @@ -141,7 +138,7 @@ void Hooks::initialize () (void) n.skip (','); } else - ; // Was: throw std::string (format ("Malformed hook definition '{1}'.", *it)); + ; // Was: throw std::string (format ("Malformed hook definition '{1}'.", it->first)); } } } diff --git a/src/Hooks.h b/src/Hooks.h index d0b6d81ec..e4697f0cd 100644 --- a/src/Hooks.h +++ b/src/Hooks.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -30,7 +30,6 @@ #include #include -#include // Hook class representing a single hook, which is just a three-way map. class Hook diff --git a/src/JSON.cpp b/src/JSON.cpp index 671717607..bbb082bd2 100644 --- a/src/JSON.cpp +++ b/src/JSON.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/JSON.h b/src/JSON.h index f7e6b43fe..57bcdf632 100644 --- a/src/JSON.h +++ b/src/JSON.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/Msg.cpp b/src/Msg.cpp index b5f2866b9..a067d17d0 100644 --- a/src/Msg.cpp +++ b/src/Msg.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2012, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,9 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include -#include //////////////////////////////////////////////////////////////////////////////// Msg::Msg () @@ -35,7 +35,7 @@ Msg::Msg () { // All messages are marked with the version number, so that the messages may // be properly evaluated in context. - _header["version"] = PACKAGE_STRING; + _header["client"] = PACKAGE_STRING; } //////////////////////////////////////////////////////////////////////////////// @@ -145,26 +145,25 @@ bool Msg::parse (const std::string& input) _header.clear (); _payload = ""; - std::vector lines; - split (lines, input.substr (0, input.size ()), '\n'); + std::string::size_type separator = input.find ("\n\n"); + if (separator == std::string::npos) + throw std::string ("ERROR: Malformed message"); + // Parse header. + std::vector lines; + split (lines, input.substr (0, separator), '\n'); std::vector ::iterator i; - bool tripped = false; for (i = lines.begin (); i != lines.end (); ++i) { - if (*i == "") - tripped = true; - else if (tripped) - _payload += *i + "\n"; - else - { - std::string::size_type delim = i->find (": "); - if (delim != std::string::npos) - _header[i->substr (0, delim)] = i->substr (delim + 2); - else + std::string::size_type delimiter = i->find (':'); + if (delimiter == std::string::npos) throw std::string ("ERROR: Malformed message header '") + *i + "'"; + + _header[trim (i->substr (0, delimiter))] = trim (i->substr (delimiter + 1)); } - } + + // Parse payload. + _payload = input.substr (separator + 2); return true; } diff --git a/src/Msg.h b/src/Msg.h index f25d4bb3e..57084140b 100644 --- a/src/Msg.h +++ b/src/Msg.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2012, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/Path.cpp b/src/Path.cpp index a934cbed8..27622509d 100644 --- a/src/Path.cpp +++ b/src/Path.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -33,8 +34,8 @@ #include #include #include +#include #include -#include //////////////////////////////////////////////////////////////////////////////// std::ostream& operator<< (std::ostream& out, const Path& path) @@ -88,6 +89,13 @@ bool Path::operator== (const Path& other) return _data == other._data; } +//////////////////////////////////////////////////////////////////////////////// +Path& Path::operator+= (const std::string& dir) +{ + _data += "/" + dir; + return *this; +} + //////////////////////////////////////////////////////////////////////////////// Path::operator std::string () const { @@ -153,7 +161,7 @@ bool Path::is_directory () const //////////////////////////////////////////////////////////////////////////////// bool Path::is_absolute () const { - if (_data.length () && _data.substr (0, 1) == "/") + if (_data.length () && _data[0] == '/') return true; return false; @@ -197,6 +205,8 @@ bool Path::rename (const std::string& new_name) // ~ --> /home/user // ~foo/x --> /home/foo/s // ~/x --> /home/foo/x +// ./x --> $PWD/x +// x --> $PWD/x std::string Path::expand (const std::string& in) { std::string copy = in; @@ -234,6 +244,23 @@ std::string Path::expand (const std::string& in) } } + // Relative paths + else if (in.length () > 2 && + in.substr (0, 2) == "./") + { + char buf[PATH_MAX]; + getcwd (buf, PATH_MAX - 1); + copy = std::string (buf) + "/" + in.substr (2); + } + else if (in.length () > 1 && + in[0] != '.' && + in[0] != '/') + { + char buf[PATH_MAX]; + getcwd (buf, PATH_MAX - 1); + copy = std::string (buf) + "/" + in; + } + return copy; } diff --git a/src/Path.h b/src/Path.h index 4dabb1266..74d0ed030 100644 --- a/src/Path.h +++ b/src/Path.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -28,7 +28,6 @@ #ifndef INCLUDED_PATH #define INCLUDED_PATH -#include #include #include @@ -42,6 +41,7 @@ public: Path& operator= (const Path&); bool operator== (const Path&); + Path& operator+= (const std::string&); operator std::string () const; std::string name () const; diff --git a/src/Socket.cpp b/src/Socket.cpp deleted file mode 100644 index 9b26cbeae..000000000 --- a/src/Socket.cpp +++ /dev/null @@ -1,307 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// taskwarrior - a command line task list manager. -// -// Copyright 2006-2012, 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//////////////////////////////////////////////////////////////////////////////// -Socket::Socket () : - _socket (0), - _limit (0), // Unlimited - _debug (false) -{ -} - -//////////////////////////////////////////////////////////////////////////////// -Socket::Socket (int s) : - _socket (s), - _limit (0), // Unlimited - _debug (false) -{ -} - -//////////////////////////////////////////////////////////////////////////////// -Socket::~Socket () -{ - close (); -} - -//////////////////////////////////////////////////////////////////////////////// -// For clients. -void Socket::connect (const std::string& host, const std::string& port) -{ - // use IPv4 or IPv6, does not matter. - struct addrinfo hints; - memset (&hints, 0, sizeof hints); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_flags = AI_PASSIVE; // use my IP - - struct addrinfo* res; - if (::getaddrinfo (host.c_str (), port.c_str (), &hints, &res) != 0) - throw "ERROR: " + std::string (::gai_strerror (errno)); - - // Try them all, stop on success. - struct addrinfo* p; - for (p = res; p != NULL; p = p->ai_next) - { - if ((_socket = ::socket (p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) - continue; - - // When a socket is closed, it remains unavailable for a while (netstat -an). - // Setting SO_REUSEADDR allows this program to assume control of a closed, - // but unavailable socket. - int on = 1; - if (::setsockopt (_socket, - SOL_SOCKET, - SO_REUSEADDR, - (const void*) &on, - sizeof (on)) == -1) - throw "ERROR: " + std::string (::strerror (errno)); - - if (::connect (_socket, p->ai_addr, p->ai_addrlen) == -1) - { - close (); - continue; - } - - break; - } - - free (res); - - if (p == NULL) - throw "ERROR: Could not connect to " + host + " " + port; -} - -//////////////////////////////////////////////////////////////////////////////// -void Socket::close () -{ - if (_socket) - ::close (_socket); - _socket = 0; -} - -//////////////////////////////////////////////////////////////////////////////// -// For servers. -void Socket::bind (const std::string& port) -{ - // use IPv4 or IPv6, does not matter. - struct addrinfo hints; - memset (&hints, 0, sizeof hints); - hints.ai_family = AF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; - hints.ai_flags = AI_PASSIVE; // use my IP - - struct addrinfo* res; - if (::getaddrinfo (NULL, port.c_str (), &hints, &res) != 0) - throw "ERROR: " + std::string (::gai_strerror (errno)); - - if ((_socket = ::socket (res->ai_family, - res->ai_socktype, - res->ai_protocol)) == -1) - throw "ERROR: Can not bind to port " + port; - - // When a socket is closed, it remains unavailable for a while (netstat -an). - // Setting SO_REUSEADDR allows this program to assume control of a closed, but - // unavailable socket. - int on = 1; - if (::setsockopt (_socket, - SOL_SOCKET, - SO_REUSEADDR, - (const void*) &on, - sizeof (on)) == -1) - throw "ERROR: " + std::string (::strerror (errno)); - - if (::bind (_socket, res->ai_addr, res->ai_addrlen) == -1) - throw "ERROR: " + std::string (::strerror (errno)); -} - -//////////////////////////////////////////////////////////////////////////////// -void Socket::listen (int queue /*= 5*/) -{ - if (::listen (_socket, queue) < 0) - throw "ERROR: " + std::string (::strerror (errno)); -} - -//////////////////////////////////////////////////////////////////////////////// -int Socket::accept () -{ - struct sockaddr_storage client; - socklen_t length = sizeof client; - int connection; - - do - { - memset (&client, 0, length); - connection = ::accept (_socket, (struct sockaddr*) &client, &length); - } - while (errno == EINTR); - - if (connection < 0) - throw "ERROR: " + std::string (::strerror (errno)); - - return connection; -} - -//////////////////////////////////////////////////////////////////////////////// -void Socket::write (const std::string& data) -{ - std::string packet = "XXXX" + data; - - // Encode the length. - unsigned long l = packet.length (); - packet[0] = l >>24; - packet[1] = l >>16; - packet[2] = l >>8; - packet[3] = l; - - int total = 0; - int remaining = packet.length (); - - while (total < remaining) - { - int status; - do - { - status = ::send (_socket, packet.c_str () + total, remaining, 0); - } - while (errno == EINTR); - - if (status == -1) - break; - - total += status; - remaining -= status; - } - - if (_debug) - std::cout << ">>> " - << data.c_str () - << " (" << total << " bytes)" - << std::endl; -} - -//////////////////////////////////////////////////////////////////////////////// -void Socket::read (std::string& data) -{ - data = ""; // No appending of data. - int received = 0; - - // Get the encoded length. - unsigned char header[4]; - do - { - received = ::recv (_socket, header, sizeof (header), 0); - } - while (errno == EINTR); - int total = received; - - // Decode the length. - unsigned long expected = (header[0]<<24) | - (header[1]<<16) | - (header[2]<<8) | - header[3]; - - // TODO This would be a good place to assert 'expected < _limit'. - - // Arbitrary buffer size. - char buffer[8192]; - - // Keep reading until no more data. Concatenate chunks of data if a) the - // read was interrupted by a signal, and b) if there is more data than - // fits in the buffer. - do - { - do - { - received = ::recv (_socket, buffer, sizeof (buffer) - 1, 0); - } - while (errno == EINTR); - - // Other end closed the connection. - if (received == 0) - break; - - // Something happened. - if (received < 0) - throw "ERROR: " + std::string (::strerror (errno)); - - buffer [received] = '\0'; - data += buffer; - total += received; - - // Stop at defined limit. - if (_limit && total > _limit) - break; - } - while (received > 0 && total < (int) expected); - - if (_debug) - std::cout << "<<< " - << data.c_str () - << " (" << total << " bytes)" - << std::endl; -} - -//////////////////////////////////////////////////////////////////////////////// -void Socket::limit (int max) -{ - _limit = max; -} - -//////////////////////////////////////////////////////////////////////////////// -// Calling this method results in all subsequent socket traffic being sent to -// std::cout, labelled with >>> for outgoing, <<< for incoming. -void Socket::debug () -{ - _debug = true; -} - -//////////////////////////////////////////////////////////////////////////////// -// get sockaddr, IPv4 or IPv6: -void* Socket::get_in_addr (struct sockaddr* sa) -{ - if (sa->sa_family == AF_INET) - return &(((struct sockaddr_in*) sa)->sin_addr); - - return &(((struct sockaddr_in6*) sa)->sin6_addr); -} - -//////////////////////////////////////////////////////////////////////////////// - diff --git a/src/TDB2.cpp b/src/TDB2.cpp index 58e17f62b..c04ccda11 100644 --- a/src/TDB2.cpp +++ b/src/TDB2.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,12 +25,14 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include #include #include #include +#include #include #include #include @@ -110,12 +112,15 @@ bool TF2::get (int id, Task& task) if (! _loaded_tasks) load_tasks (); - std::vector ::iterator i; - for (i = _tasks.begin (); i != _tasks.end (); ++i) + // This is an optimization. Since the 'id' is based on the line number of + // pending.data file, the task in question cannot appear earlier than line + // (id - 1) in the file. It can, however, appear significantly later because + // it is not known how recent a GC operation was run. + for (int i = id - 1; i < _tasks.size (); ++i) { - if (i->id == id) + if (_tasks[i].id == id) { - task = *i; + task = _tasks[i]; return true; } } @@ -222,7 +227,7 @@ void TF2::commit () task != _added_tasks.end (); ++task) { - _file.append (task->composeF4 ()); + _file.append (task->composeF4 () + "\n"); } _added_tasks.clear (); @@ -254,7 +259,7 @@ void TF2::commit () task != _tasks.end (); ++task) { - _file.append (task->composeF4 ()); + _file.append (task->composeF4 () + "\n"); } // Write out all the added lines. @@ -564,12 +569,12 @@ void TDB2::add (Task& task, bool add_to_backlog /* = true */) // new // --- undo.add_line ("time " + Date ().toEpochString () + "\n"); - undo.add_line ("new " + task.composeF4 ()); + undo.add_line ("new " + task.composeF4 () + "\n"); undo.add_line ("---\n"); // Add task to backlog. if (add_to_backlog) - backlog.add_task (task); + backlog.add_line (task.composeJSON () + "\n"); } //////////////////////////////////////////////////////////////////////////////// @@ -596,19 +601,28 @@ void TDB2::modify (Task& task, bool add_to_backlog /* = true */) // new // --- undo.add_line ("time " + Date ().toEpochString () + "\n"); - undo.add_line ("old " + original.composeF4 ()); - undo.add_line ("new " + task.composeF4 ()); + undo.add_line ("old " + original.composeF4 () + "\n"); + undo.add_line ("new " + task.composeF4 () + "\n"); undo.add_line ("---\n"); // Add modified task to backlog. if (add_to_backlog) - backlog.add_task (task); + backlog.add_line (task.composeJSON () + "\n"); } } //////////////////////////////////////////////////////////////////////////////// void TDB2::commit () { + // Ignore harmful signals. + signal (SIGHUP, SIG_IGN); + signal (SIGINT, SIG_IGN); + signal (SIGKILL, SIG_IGN); + signal (SIGPIPE, SIG_IGN); + signal (SIGTERM, SIG_IGN); + signal (SIGUSR1, SIG_IGN); + signal (SIGUSR2, SIG_IGN); + dump (); context.timer_commit.start (); @@ -617,6 +631,15 @@ void TDB2::commit () undo.commit (); backlog.commit (); + // Restore signal handling. + signal (SIGHUP, SIG_DFL); + signal (SIGINT, SIG_DFL); + signal (SIGKILL, SIG_DFL); + signal (SIGPIPE, SIG_DFL); + signal (SIGTERM, SIG_DFL); + signal (SIGUSR1, SIG_DFL); + signal (SIGUSR2, SIG_DFL); + context.timer_commit.stop (); } @@ -675,7 +698,7 @@ void readTaskmods (std::vector &input, void TDB2::merge (const std::string& mergeFile) { /////////////////////////////////////// - // Copyright 2010 - 2013, Johannes Schlatow. + // Copyright 2010 - 2014, Johannes Schlatow. /////////////////////////////////////// // list of modifications that we want to add to the local database @@ -746,7 +769,7 @@ void TDB2::merge (const std::string& mergeFile) tmp_lit++; tmp_rit++; } - + if (lookahead == -1) { // at this point we know that the first lines are the same undo_lines.push_back (lline + "\n"); @@ -763,7 +786,7 @@ void TDB2::merge (const std::string& mergeFile) bool found = false; for (std::vector::const_iterator tmp_lit = lit, tmp_rit = rit; (tmp_lit != l.end ()) && (tmp_rit != r.end ()); - ++tmp_lit, ++tmp_rit) + ++tmp_lit, ++tmp_rit) { lline = *tmp_lit; rline = *tmp_rit; @@ -855,7 +878,7 @@ void TDB2::merge (const std::string& mergeFile) // point in time. Normally this case will be solved by the merge logic, // BUT if the UUID is considered new the merge logic will be skipped. // - // This flaw resulted in a couple of duplication issues and bloated + // This flaw resulted in a couple of duplication issues and bloated // undo files (e.g. #1104). // // This is just a "hack" which discards all the modifications of the @@ -969,7 +992,7 @@ void TDB2::merge (const std::string& mergeFile) // inserting right mod into history of local database // so that it can be restored later - // AND more important: create a history that looks the same + // AND more important: create a history that looks the same // as if we switched the roles 'remote' and 'local' // thus we have to find the oldest change on the local branch that is not on remote branch @@ -1111,9 +1134,7 @@ void TDB2::merge (const std::string& mergeFile) << "\n"; */ - // remove the \n from composeF4() string std::string newline = tmod.getAfter ().composeF4 (); - newline = newline.substr (0, newline.length ()-1); // does the tasks move to pending data? // this taskmod will not arise from @@ -1153,10 +1174,7 @@ void TDB2::merge (const std::string& mergeFile) cutOff (tmod.getBefore ().get ("description"), 10)) << "\n"; - // remove the \n from composeF4() string - // which will replace the current line std::string newline = tmod.getAfter ().composeF4 (); - newline = newline.substr (0, newline.length ()-1); // does the tasks move to completed data if ( (statusAfter == Task::completed) @@ -1214,10 +1232,7 @@ void TDB2::merge (const std::string& mergeFile) cutOff (tmod.getAfter ().get ("description"), 10)) << "\n"; - // remove the \n from composeF4() string - std::string newline = tmod.getAfter ().composeF4 (); - newline = newline.substr (0, newline.length ()-1); - pending_lines.push_back (newline); + pending_lines.push_back (tmod.getAfter ().composeF4 ()); } else { @@ -1262,18 +1277,92 @@ void TDB2::merge (const std::string& mergeFile) //////////////////////////////////////////////////////////////////////////////// void TDB2::revert () { + // Extract the details of the last txn, and roll it back. std::vector u = undo.get_lines (); + std::string uuid; + std::string when; + std::string current; + std::string prior; + revert_undo (u, uuid, when, current, prior); + + // Display diff and confirm. + show_diff (current, prior, when); + if (! context.config.getBoolean ("confirmation") || + confirm (STRING_TDB2_UNDO_CONFIRM)) + { + // There are six kinds of change possible. Determine which one, and act + // accordingly. + // + // Revert: task add + // [1] 0 --> p + // - erase from pending + // - if in backlog, erase, else cannot undo + // + // Revert: task modify + // [2] p --> p' + // - write prior over current in pending + // - add prior to backlog + // + // Revert: task done/delete + // [3] p --> c + // - add prior to pending + // - erase from completed + // - add prior to backlog + // + // Revert: task modify + // [4] c --> p + // - add prior to completed + // - erase from pending + // - add prior to backlog + // + // Revert: task modify + // [5] c --> c' + // - write prior over current in completed + // - add prior to backlog + // + // Revert: task log + // [6] 0 --> c + // - erase from completed + // - if in backlog, erase, else cannot undo + + // Modify other data files accordingly. + std::vector p = pending.get_lines (); + revert_pending (p, uuid, current, prior); + + std::vector c = completed.get_lines (); + revert_completed (p, c, uuid, current, prior); + + std::vector b = backlog.get_lines (); + revert_backlog (b, uuid, current, prior); + + // Commit. If processing makes it this far with no exceptions, then we're + // done. + File::write (undo._file._data, u); + File::write (pending._file._data, p); + File::write (completed._file._data, c); + File::write (backlog._file._data, b); + } + else + std::cout << STRING_CMD_CONFIG_NO_CHANGE << "\n"; +} + +//////////////////////////////////////////////////////////////////////////////// +void TDB2::revert_undo ( + std::vector & u, + std::string& uuid, + std::string& when, + std::string& current, + std::string& prior) +{ if (u.size () < 3) throw std::string (STRING_TDB2_NO_UNDO); // pop last tx u.pop_back (); // separator. - std::string current = u.back ().substr (4); + current = u.back ().substr (4); u.pop_back (); - std::string prior; - std::string when; if (u.back ().substr (0, 5) == "time ") { when = u.back ().substr (5); @@ -1288,6 +1377,146 @@ void TDB2::revert () u.pop_back (); } + // Extract identifying uuid. + std::string::size_type uuidAtt = current.find ("uuid:\""); + if (uuidAtt != std::string::npos) + uuid = current.substr (uuidAtt + 6, 36); // "uuid:"" --> + else + throw std::string (STRING_TDB2_MISSING_UUID); +} + +//////////////////////////////////////////////////////////////////////////////// +void TDB2::revert_pending ( + std::vector & p, + const std::string& uuid, + const std::string& current, + const std::string& prior) +{ + std::string uuid_att = "uuid:\"" + uuid + "\""; + + // is 'current' in pending? + std::vector ::iterator task; + for (task = p.begin (); task != p.end (); ++task) + { + if (task->find (uuid_att) != std::string::npos) + { + context.debug ("TDB::revert - task found in pending.data"); + + // Either revert if there was a prior state, or remove the task. + if (prior != "") + { + *task = prior; + std::cout << STRING_TDB2_REVERTED << "\n"; + } + else + { + p.erase (task); + std::cout << STRING_TDB2_REMOVED << "\n"; + } + + break; + } + } +} + +//////////////////////////////////////////////////////////////////////////////// +void TDB2::revert_completed ( + std::vector & p, + std::vector & c, + const std::string& uuid, + const std::string& current, + const std::string& prior) +{ + std::string uuid_att = "uuid:\"" + uuid + "\""; + + // is 'current' in completed? + std::vector ::iterator task; + for (task = c.begin (); task != c.end (); ++task) + { + if (task->find (uuid_att) != std::string::npos) + { + context.debug ("TDB::revert_completed - task found in completed.data"); + + // Either revert if there was a prior state, or remove the task. + if (prior != "") + { + *task = prior; + if (task->find ("status:\"pending\"") != std::string::npos || + task->find ("status:\"waiting\"") != std::string::npos || + task->find ("status:\"recurring\"") != std::string::npos) + { + c.erase (task); + p.push_back (prior); + std::cout << STRING_TDB2_REVERTED << "\n"; + context.debug ("TDB::revert_completed - task belongs in pending.data"); + } + else + { + std::cout << STRING_TDB2_REVERTED << "\n"; + context.debug ("TDB::revert_completed - task belongs in completed.data"); + } + } + else + { + c.erase (task); + + std::cout << STRING_TDB2_REVERTED << "\n"; + context.debug ("TDB::revert_completed - task removed"); + } + + std::cout << STRING_TDB2_UNDO_COMPLETE << "\n"; + break; + } + } +} + +//////////////////////////////////////////////////////////////////////////////// +void TDB2::revert_backlog ( + std::vector & b, + const std::string& uuid, + const std::string& current, + const std::string& prior) +{ + std::string uuid_att = "\"uuid\":\"" + uuid + "\""; + + bool found = false; + std::vector ::reverse_iterator task; + for (task = b.rbegin (); task != b.rend (); ++task) + { + if (task->find (uuid_att) != std::string::npos) + { + context.debug ("TDB::revert_backlog - task found in backlog.data"); + found = true; + + // If this is a new task (no prior), then just remove it from the backlog. + if (current != "" && prior == "") + { + // Yes, this is what is needed, when you want to erase using a reverse + // iterator. + b.erase ((++task).base ()); + } + + // If this is a modification of some kind, add the prior to the backlog. + else + { + Task t (prior); + b.push_back (t.composeJSON ()); + } + + break; + } + } + + if (!found) + throw std::string (STRING_TDB2_UNDO_SYNCED); +} + +//////////////////////////////////////////////////////////////////////////////// +void TDB2::show_diff ( + const std::string& current, + const std::string& prior, + const std::string& when) +{ Date lastChange (strtol (when.c_str (), NULL, 10)); // Set the colors. @@ -1500,106 +1729,6 @@ void TDB2::revert () << "\n"; } - // Output displayed, now confirm. - if (context.config.getBoolean ("confirmation") && - !confirm (STRING_TDB2_UNDO_CONFIRM)) - { - std::cout << STRING_CMD_CONFIG_NO_CHANGE << "\n"; - return; - } - - // Extract identifying uuid. - std::string uuid; - std::string::size_type uuidAtt = current.find ("uuid:\""); - if (uuidAtt != std::string::npos) - uuid = current.substr (uuidAtt, 43); // 43 = uuid:"..." - else - throw std::string (STRING_TDB2_MISSING_UUID); - - // load pending.data - std::vector p = pending.get_lines (); - - // is 'current' in pending? - std::vector ::iterator task; - for (task = p.begin (); task != p.end (); ++task) - { - if (task->find (uuid) != std::string::npos) - { - context.debug ("TDB::undo - task found in pending.data"); - - // Either revert if there was a prior state, or remove the task. - if (prior != "") - { - *task = prior; - std::cout << STRING_TDB2_REVERTED << "\n"; - } - else - { - p.erase (task); - std::cout << STRING_TDB2_REMOVED << "\n"; - } - - // Rewrite files. - File::write (pending._file._data, p); - File::write (undo._file._data, u); - return; - } - } - - // load completed.data - std::vector c = completed.get_lines (); - - // is 'current' in completed? - for (task = c.begin (); task != c.end (); ++task) - { - if (task->find (uuid) != std::string::npos) - { - context.debug ("TDB::undo - task found in completed.data"); - - // Either revert if there was a prior state, or remove the task. - if (prior != "") - { - *task = prior; - if (task->find ("status:\"pending\"") != std::string::npos || - task->find ("status:\"waiting\"") != std::string::npos || - task->find ("status:\"recurring\"") != std::string::npos) - { - c.erase (task); - p.push_back (prior); - File::write (completed._file._data, c); - File::write (pending._file._data, p); - File::write (undo._file._data, u); - std::cout << STRING_TDB2_REVERTED << "\n"; - context.debug ("TDB::undo - task belongs in pending.data"); - } - else - { - File::write (completed._file._data, c); - File::write (undo._file._data, u); - std::cout << STRING_TDB2_REVERTED << "\n"; - context.debug ("TDB::undo - task belongs in completed.data"); - } - } - else - { - c.erase (task); - File::write (completed._file._data, c); - File::write (undo._file._data, u); - std::cout << STRING_TDB2_REVERTED << "\n"; - context.debug ("TDB::undo - task removed"); - } - - std::cout << STRING_TDB2_UNDO_COMPLETE << "\n"; - return; - } - } - - // Perhaps user hand-edited the data files? - // Perhaps the task was in completed.data, which was still in file format 3? - std::cout << format (STRING_TDB2_MISSING_TASK, uuid.substr (6, 36)) - << "\n" - << STRING_TDB2_UNDO_IMPOSSIBLE - << "\n"; } //////////////////////////////////////////////////////////////////////////////// @@ -1752,9 +1881,9 @@ int TDB2::next_id () const std::vector TDB2::all_tasks () { std::vector all (pending._tasks.size () + - pending._added_tasks.size () + - completed._tasks.size () + - completed._added_tasks.size ()); + pending._added_tasks.size () + + completed._tasks.size () + + completed._added_tasks.size ()); all = pending.get_tasks (); std::vector extra (completed._tasks.size () + diff --git a/src/TDB2.h b/src/TDB2.h index 199724828..3654f2761 100644 --- a/src/TDB2.h +++ b/src/TDB2.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -127,6 +127,11 @@ public: private: bool verifyUniqueUUID (const std::string&); + void show_diff (const std::string&, const std::string&, const std::string&); + void revert_undo (std::vector &, std::string&, std::string&, std::string&, std::string&); + void revert_pending (std::vector &, const std::string&, const std::string&, const std::string&); + void revert_completed (std::vector &, std::vector &, const std::string&, const std::string&, const std::string&); + void revert_backlog (std::vector &, const std::string&, const std::string&, const std::string&); public: TF2 pending; diff --git a/src/TLSClient.cpp b/src/TLSClient.cpp new file mode 100644 index 000000000..b6efc068a --- /dev/null +++ b/src/TLSClient.cpp @@ -0,0 +1,407 @@ +//////////////////////////////////////////////////////////////////////////////// +// taskwarrior - a command line task list manager. +// +// Copyright 2006 - 2014, 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 + +#ifdef HAVE_LIBGNUTLS + +#include +#include +#include +#include +#include +#include +#include +#ifdef OPENBSD +#include +#else +#include +#endif +#include +#include +#include +#include +#include + +#define MAX_BUF 16384 + +static int verify_certificate_callback (gnutls_session_t); + +static bool trust_override = false; + +//////////////////////////////////////////////////////////////////////////////// +static void gnutls_log_function (int level, const char* message) +{ + std::cout << "c: " << level << " " << message; +} + +//////////////////////////////////////////////////////////////////////////////// +static int verify_certificate_callback (gnutls_session_t session) +{ + if (trust_override) + return 0; + + // Get the hostname from the session. + const char* hostname = (const char*) gnutls_session_get_ptr (session); + + // This verification function uses the trusted CAs in the credentials + // structure. So you must have installed one or more CA certificates. + unsigned int status = 0; +#if GNUTLS_VERSION_NUMBER >= 0x030104 + int ret = gnutls_certificate_verify_peers3 (session, NULL, &status); +#else + int ret = gnutls_certificate_verify_peers2 (session, &status); +#endif + if (ret < 0) + return GNUTLS_E_CERTIFICATE_ERROR; + +#if GNUTLS_VERSION_NUMBER >= 0x030105 + gnutls_certificate_type_t type = gnutls_certificate_type_get (session); + gnutls_datum_t out; + ret = gnutls_certificate_verification_status_print (status, type, &out, 0); + if (ret < 0) + return GNUTLS_E_CERTIFICATE_ERROR; + + std::cout << "c: INFO " << out.data << "\n"; + + gnutls_free (out.data); +#endif + + if (status != 0) + return GNUTLS_E_CERTIFICATE_ERROR; + + // Continue handshake. + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// +TLSClient::TLSClient () +: _ca ("") +, _cert ("") +, _key ("") +, _socket (0) +, _limit (0) +, _debug (false) +{ +} + +//////////////////////////////////////////////////////////////////////////////// +TLSClient::~TLSClient () +{ + gnutls_deinit (_session); + gnutls_certificate_free_credentials (_credentials); + gnutls_global_deinit (); + + if (_socket) + { + shutdown (_socket, SHUT_RDWR); + close (_socket); + } +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::limit (int max) +{ + _limit = max; +} + +//////////////////////////////////////////////////////////////////////////////// +// Calling this method results in all subsequent socket traffic being sent to +// std::cout, labelled with 'c: ...'. +void TLSClient::debug (int level) +{ + if (level) + _debug = true; + + gnutls_global_set_log_function (gnutls_log_function); + gnutls_global_set_log_level (level); +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::trust (bool value) +{ + trust_override = value; + if (_debug) + { + if (trust_override) + std::cout << "c: INFO Server certificate trusted automatically.\n"; + else + std::cout << "c: INFO Server certificate trust verified.\n"; + } +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::ciphers (const std::string& cipher_list) +{ + _ciphers = cipher_list; +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::init ( + const std::string& ca, + const std::string& cert, + const std::string& key) +{ + _ca = ca; + _cert = cert; + _key = key; + + gnutls_global_init (); + gnutls_certificate_allocate_credentials (&_credentials); + + if (_ca != "" && + gnutls_certificate_set_x509_trust_file (_credentials, _ca.c_str (), GNUTLS_X509_FMT_PEM) < 0) + throw std::string ("Missing CA file."); + + if (_cert != "" && + _key != "" && + gnutls_certificate_set_x509_key_file (_credentials, _cert.c_str (), _key.c_str (), GNUTLS_X509_FMT_PEM) < 0) + throw std::string ("Missing CERT file."); + +#if GNUTLS_VERSION_NUMBER >= 0x02090a + gnutls_certificate_set_verify_function (_credentials, verify_certificate_callback); +#endif + gnutls_init (&_session, GNUTLS_CLIENT); + + // Use default priorities unless overridden. + if (_ciphers == "") + _ciphers = "NORMAL"; + + const char *err; + int ret = gnutls_priority_set_direct (_session, _ciphers.c_str (), &err); + if (ret < 0) + { + if (_debug && ret == GNUTLS_E_INVALID_REQUEST) + std::cout << "c: ERROR Priority error at: " << err << "\n"; + + throw std::string (STRING_TLS_INIT_FAIL); + } + + // Apply the x509 credentials to the current session. + gnutls_credentials_set (_session, GNUTLS_CRD_CERTIFICATE, _credentials); +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::connect (const std::string& host, const std::string& port) +{ + // Store the host name, so the verification callback can access it during the + // handshake below. + gnutls_session_set_ptr (_session, (void*) host.c_str ()); + + // use IPv4 or IPv6, does not matter. + struct addrinfo hints = {0}; + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; // use my IP + + struct addrinfo* res; + if (::getaddrinfo (host.c_str (), port.c_str (), &hints, &res) != 0) + throw std::string (::gai_strerror (errno)); + + // Try them all, stop on success. + struct addrinfo* p; + for (p = res; p != NULL; p = p->ai_next) + { + if ((_socket = ::socket (p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) + continue; + + // When a socket is closed, it remains unavailable for a while (netstat -an). + // Setting SO_REUSEADDR allows this program to assume control of a closed, + // but unavailable socket. + int on = 1; + if (::setsockopt (_socket, + SOL_SOCKET, + SO_REUSEADDR, + (const void*) &on, + sizeof (on)) == -1) + throw std::string (::strerror (errno)); + + if (::connect (_socket, p->ai_addr, p->ai_addrlen) == -1) + continue; + + break; + } + + free (res); + + if (p == NULL) + throw format (STRING_CMD_SYNC_CONNECT, host, port); + +#if GNUTLS_VERSION_NUMBER >= 0x030109 + gnutls_transport_set_int (_session, _socket); +#else + gnutls_transport_set_ptr (_session, (gnutls_transport_ptr_t) (long) _socket); +#endif + + // Perform the TLS handshake + int ret; + do + { + ret = gnutls_handshake (_session); + } + while (ret < 0 && gnutls_error_is_fatal (ret) == 0); + if (ret < 0) + throw format (STRING_CMD_SYNC_HANDSHAKE, gnutls_strerror (ret)); + + if (_debug) + { +#if GNUTLS_VERSION_NUMBER >= 0x03010a + char* desc = gnutls_session_get_desc (_session); + std::cout << "c: INFO Handshake was completed: " << desc << "\n"; + gnutls_free (desc); +#else + std::cout << "c: INFO Handshake was completed.\n"; +#endif + } +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::bye () +{ + gnutls_bye (_session, GNUTLS_SHUT_RDWR); +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::send (const std::string& data) +{ + std::string packet = "XXXX" + data; + + // Encode the length. + unsigned long l = packet.length (); + packet[0] = l >>24; + packet[1] = l >>16; + packet[2] = l >>8; + packet[3] = l; + + unsigned int total = 0; + unsigned int remaining = packet.length (); + + while (total < packet.length ()) + { + int status; + do + { + status = gnutls_record_send (_session, packet.c_str () + total, remaining); + } + while (errno == GNUTLS_E_INTERRUPTED || + errno == GNUTLS_E_AGAIN); + + if (status == -1) + break; + + total += (unsigned int) status; + remaining -= (unsigned int) status; + } + + if (_debug) + std::cout << "c: INFO Sending 'XXXX" + << data.c_str () + << "' (" << total << " bytes)" + << std::endl; +} + +//////////////////////////////////////////////////////////////////////////////// +void TLSClient::recv (std::string& data) +{ + data = ""; // No appending of data. + int received = 0; + + // Get the encoded length. + unsigned char header[4] = {0}; + do + { + received = gnutls_record_recv (_session, header, 4); + } + while (received > 0 && + (errno == GNUTLS_E_INTERRUPTED || + errno == GNUTLS_E_AGAIN)); + + int total = received; + + // Decode the length. + unsigned long expected = (header[0]<<24) | + (header[1]<<16) | + (header[2]<<8) | + header[3]; + if (_debug) + std::cout << "c: INFO expecting " << expected << " bytes.\n"; + + // TODO This would be a good place to assert 'expected < _limit'. + + // Arbitrary buffer size. + char buffer[MAX_BUF]; + + // Keep reading until no more data. Concatenate chunks of data if a) the + // read was interrupted by a signal, and b) if there is more data than + // fits in the buffer. + do + { + do + { + received = gnutls_record_recv (_session, buffer, MAX_BUF - 1); + } + while (received > 0 && + (errno == GNUTLS_E_INTERRUPTED || + errno == GNUTLS_E_AGAIN)); + + // Other end closed the connection. + if (received == 0) + { + if (_debug) + std::cout << "c: INFO Peer has closed the TLS connection\n"; + break; + } + + // Something happened. + if (received < 0 && gnutls_error_is_fatal (received) == 0) + { + if (_debug) + std::cout << "c: WARNING " << gnutls_strerror (received) << "\n"; + } + + else if (received < 0) + throw std::string (gnutls_strerror (received)); + + buffer [received] = '\0'; + data += buffer; + total += received; + + // Stop at defined limit. + if (_limit && total > _limit) + break; + } + while (received > 0 && total < (int) expected); + + if (_debug) + std::cout << "c: INFO Receiving 'XXXX" + << data.c_str () + << "' (" << total << " bytes)" + << std::endl; +} + +//////////////////////////////////////////////////////////////////////////////// +#endif diff --git a/src/TLSClient.h b/src/TLSClient.h new file mode 100644 index 000000000..bcca96a33 --- /dev/null +++ b/src/TLSClient.h @@ -0,0 +1,67 @@ +//////////////////////////////////////////////////////////////////////////////// +// taskwarrior - a command line task list manager. +// +// Copyright 2006 - 2014, 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 +// +//////////////////////////////////////////////////////////////////////////////// +#ifndef INCLUDED_TLSCLIENT +#define INCLUDED_TLSCLIENT + +#ifdef HAVE_LIBGNUTLS + +#include +#include + +class TLSClient +{ +public: + TLSClient (); + ~TLSClient (); + void limit (int); + void debug (int); + void trust (bool); + void ciphers (const std::string&); + void init (const std::string&, const std::string&, const std::string&); + void connect (const std::string&, const std::string&); + void bye (); + + void send (const std::string&); + void recv (std::string&); + +private: + std::string _ca; + std::string _cert; + std::string _key; + std::string _ciphers; + gnutls_certificate_credentials_t _credentials; + gnutls_session_t _session; + int _socket; + int _limit; + bool _debug; +}; + +#endif +#endif + +//////////////////////////////////////////////////////////////////////////////// + diff --git a/src/Task.cpp b/src/Task.cpp index 2091deefd..53bff51ae 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,78 +25,65 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include +#ifdef PRODUCT_TASKWARRIOR #include +#endif #include +#ifdef PRODUCT_TASKWARRIOR #include #include +#endif #include #include #include #include +#ifdef PRODUCT_TASKWARRIOR #include +#endif #include #include + #include +#ifdef PRODUCT_TASKWARRIOR #include +#include + #define APPROACHING_INFINITY 1000 // Close enough. This isn't rocket surgery. extern Context context; static const float epsilon = 0.000001; +#endif -static std::map coefficients; -float urgencyPriorityCoefficient = 0.0; -float urgencyProjectCoefficient = 0.0; -float urgencyActiveCoefficient = 0.0; -float urgencyScheduledCoefficient = 0.0; -float urgencyWaitingCoefficient = 0.0; -float urgencyBlockedCoefficient = 0.0; -float urgencyAnnotationsCoefficient = 0.0; -float urgencyTagsCoefficient = 0.0; -float urgencyNextCoefficient = 0.0; -float urgencyDueCoefficient = 0.0; -float urgencyBlockingCoefficient = 0.0; -float urgencyAgeCoefficient = 0.0; +std::string Task::defaultProject = ""; +std::string Task::defaultPriority = ""; +std::string Task::defaultDue = ""; +bool Task::searchCaseSensitive = true; +bool Task::regex = false; +std::map Task::attributes; + +std::map Task::coefficients; +float Task::urgencyPriorityCoefficient = 0.0; +float Task::urgencyProjectCoefficient = 0.0; +float Task::urgencyActiveCoefficient = 0.0; +float Task::urgencyScheduledCoefficient = 0.0; +float Task::urgencyWaitingCoefficient = 0.0; +float Task::urgencyBlockedCoefficient = 0.0; +float Task::urgencyAnnotationsCoefficient = 0.0; +float Task::urgencyTagsCoefficient = 0.0; +float Task::urgencyNextCoefficient = 0.0; +float Task::urgencyDueCoefficient = 0.0; +float Task::urgencyBlockingCoefficient = 0.0; +float Task::urgencyAgeCoefficient = 0.0; +float Task::urgencyAgeMax = 0.0; static const std::string dummy (""); -//////////////////////////////////////////////////////////////////////////////// -// Non-method. -// -// This is essentialy a cache of float values to save iteration and hash lookup -// in the whole config at time of Task::urgency_C. -void initializeUrgencyCoefficients () -{ - urgencyPriorityCoefficient = context.config.getReal ("urgency.priority.coefficient"); - urgencyProjectCoefficient = context.config.getReal ("urgency.project.coefficient"); - urgencyActiveCoefficient = context.config.getReal ("urgency.active.coefficient"); - urgencyScheduledCoefficient = context.config.getReal ("urgency.scheduled.coefficient"); - urgencyWaitingCoefficient = context.config.getReal ("urgency.waiting.coefficient"); - urgencyBlockedCoefficient = context.config.getReal ("urgency.blocked.coefficient"); - urgencyAnnotationsCoefficient = context.config.getReal ("urgency.annotations.coefficient"); - urgencyTagsCoefficient = context.config.getReal ("urgency.tags.coefficient"); - urgencyNextCoefficient = context.config.getReal ("urgency.next.coefficient"); - urgencyDueCoefficient = context.config.getReal ("urgency.due.coefficient"); - urgencyBlockingCoefficient = context.config.getReal ("urgency.blocking.coefficient"); - urgencyAgeCoefficient = context.config.getReal ("urgency.age.coefficient"); - - // Tag- and project-specific coefficients. - std::vector all; - context.config.all (all); - - std::vector ::iterator var; - for (var = all.begin (); var != all.end (); ++var) - { - if (var->substr (0, 13) == "urgency.user." || - var->substr (0, 12) == "urgency.uda.") - coefficients[*var] = context.config.getReal (*var); - } -} - //////////////////////////////////////////////////////////////////////////////// Task::Task () : id (0) @@ -120,7 +107,6 @@ Task& Task::operator= (const Task& other) if (this != &other) { std::map ::operator= (other); - id = other.id; urgency_value = other.urgency_value; recalc_urgency = other.recalc_urgency; @@ -338,6 +324,7 @@ void Task::setStatus (Task::status status) recalc_urgency = true; } +#ifdef PRODUCT_TASKWARRIOR //////////////////////////////////////////////////////////////////////////////// bool Task::is_due () const { @@ -374,6 +361,68 @@ bool Task::is_duetoday () const return false; } +//////////////////////////////////////////////////////////////////////////////// +bool Task::is_dueweek () const +{ + if (has ("due")) + { + Task::status status = getStatus (); + + if (status != Task::completed && + status != Task::deleted) + { + Date now; + Date due (get_date ("due")); + if (now.year () == due.year () && + now.week () == due.week ()) + return true; + } + } + + return false; +} + +//////////////////////////////////////////////////////////////////////////////// +bool Task::is_duemonth () const +{ + if (has ("due")) + { + Task::status status = getStatus (); + + if (status != Task::completed && + status != Task::deleted) + { + Date now; + Date due (get_date ("due")); + if (now.year () == due.year () && + now.month () == due.month ()) + return true; + } + } + + return false; +} + +//////////////////////////////////////////////////////////////////////////////// +bool Task::is_dueyear () const +{ + if (has ("due")) + { + Task::status status = getStatus (); + + if (status != Task::completed && + status != Task::deleted) + { + Date now; + Date due (get_date ("due")); + if (now.year () == due.year ()) + return true; + } + } + + return false; +} + //////////////////////////////////////////////////////////////////////////////// bool Task::is_overdue () const { @@ -391,10 +440,13 @@ bool Task::is_overdue () const return false; } +#endif //////////////////////////////////////////////////////////////////////////////// // Attempt an FF4 parse first, using Task::parse, and in the event of an error -// try a legacy parse (F3, FF2). Note that FF1 is no longer supported. +// try a JSON parse, otherwise a legacy parse (FF3). +// +// Note that FF1 and FF2 are no longer supported. // // start --> [ --> Att --> ] --> end // ^ | @@ -410,129 +462,189 @@ void Task::parse (const std::string& input) try { + // File format version 4, from 2009-5-16 - now, v1.7.1+ + // This is the parse format tried first, because it is most used. clear (); - Nibbler n (copy); - std::string line; - if (n.skip ('[') && - n.getUntil (']', line) && - n.skip (']') && - n.depleted ()) + if (copy[0] == '[') { - if (line.length () == 0) - throw std::string (STRING_RECORD_EMPTY); - - Nibbler nl (line); - std::string name; - std::string value; - while (!nl.depleted ()) + Nibbler n (copy); + std::string line; + if (n.skip ('[') && + n.getUntil (']', line) && + n.skip (']') && + n.depleted ()) { - if (nl.getUntil (':', name) && - nl.skip (':') && - nl.getQuoted ('"', value)) + if (line.length () == 0) + throw std::string (STRING_RECORD_EMPTY); + + Nibbler nl (line); + std::string name; + std::string value; + while (!nl.depleted ()) { - // Experimental legacy value translation of 'recur:m' --> 'recur:mo'. - if (name == "recur" && - digitsOnly (value.substr (0, value.length () - 1)) && - value[value.length () - 1] == 'm') - value += 'o'; + if (nl.getUntil (':', name) && + nl.skip (':') && + nl.getQuoted ('"', value)) + { + // Experimental legacy value translation of 'recur:m' --> 'recur:mo'. + if (name == "recur" && + digitsOnly (value.substr (0, value.length () - 1)) && + value[value.length () - 1] == 'm') + value += 'o'; - if (name.substr (0, 11) == "annotation_") - ++annotation_count; + if (name.substr (0, 11) == "annotation_") + ++annotation_count; - (*this)[name] = decode (json::decode (value)); + (*this)[name] = decode (json::decode (value)); + } + + nl.skip (' '); } - nl.skip (' '); + std::string remainder; + nl.getUntilEOS (remainder); + if (remainder.length ()) + throw std::string (STRING_RECORD_JUNK_AT_EOL); } - - std::string remainder; - nl.getUntilEOS (remainder); - if (remainder.length ()) - throw std::string (STRING_RECORD_JUNK_AT_EOL); } + else if (copy[0] == '{') + parseJSON (copy); else throw std::string (STRING_RECORD_NOT_FF4); } catch (const std::string&) { - legacyParse (copy); + parseLegacy (copy); } recalc_urgency = true; } +//////////////////////////////////////////////////////////////////////////////// +// Note that all fields undergo encode/decode. +void Task::parseJSON (const std::string& line) +{ + // Parse the whole thing. + json::value* root = json::parse (line); + if (root->type () == json::j_object) + { + json::object* root_obj = (json::object*)root; + + // For each object element... + json_object_iter i; + for (i = root_obj->_data.begin (); + i != root_obj->_data.end (); + ++i) + { + // If the attribute is a recognized column. + std::string type = Task::attributes[i->first]; + if (type != "") + { + // Any specified id is ignored. + if (i->first == "id") + ; + + // Urgency, if present, is ignored. + else if (i->first == "urgency") + ; + + // Dates are converted from ISO to epoch. + else if (type == "date") + { + Date d (unquoteText (i->second->dump ())); + set (i->first, d.toEpochString ()); + } + + // Tags are an array of JSON strings. + else if (i->first == "tags") + { + json::array* tags = (json::array*)i->second; + json_array_iter t; + for (t = tags->_data.begin (); + t != tags->_data.end (); + ++t) + { + json::string* tag = (json::string*)*t; + addTag (tag->_data); + } + } + + // Strings are decoded. + else if (type == "string") + set (i->first, json::decode (unquoteText (i->second->dump ()))); + + // Other types are simply added. + else + set (i->first, unquoteText (i->second->dump ())); + } + + // UDA orphans and annotations do not have columns. + else + { + // Annotations are an array of JSON objects with 'entry' and + // 'description' values and must be converted. + if (i->first == "annotations") + { + std::map annos; + + json::array* atts = (json::array*)i->second; + json_array_iter annotations; + for (annotations = atts->_data.begin (); + annotations != atts->_data.end (); + ++annotations) + { + json::object* annotation = (json::object*)*annotations; + json::string* when = (json::string*)annotation->_data["entry"]; + json::string* what = (json::string*)annotation->_data["description"]; + + if (! when) + throw format (STRING_TASK_NO_ENTRY, line); + + if (! what) + throw format (STRING_TASK_NO_DESC, line); + + std::string name = "annotation_" + Date (when->_data).toEpochString (); + annos.insert (std::make_pair (name, json::decode (what->_data))); + } + + setAnnotations (annos); + } + + // UDA Orphan - must be preserved. + else + { +#ifdef PRODUCT_TASKWARRIOR + std::stringstream message; + message << "Task::parseJSON found orphan '" + << i->first + << "' with value '" + << i->second + << "' --> preserved\n"; + context.debug (message.str ()); +#endif + set (i->first, json::decode (unquoteText (i->second->dump ()))); + } + } + } + } +} + //////////////////////////////////////////////////////////////////////////////// // Support FF2, FF3. // Thankfully FF1 is no longer supported. -void Task::legacyParse (const std::string& line) +void Task::parseLegacy (const std::string& line) { switch (determineVersion (line)) { - // File format version 1, from 2006.11.27 - 2007.12.31 - case 1: - throw std::string (STRING_TASK_NO_FF1); - break; + // File format version 1, from 2006-11-27 - 2007-12-31, v0.x+ - v0.9.3 + case 1: throw std::string (STRING_TASK_NO_FF1); - // File format version 2, from 2008.1.1 - 2009.3.23 - case 2: - { - if (line.length () > 46) // ^.{36} . \[\] \[\] \n - { - set ("uuid", line.substr (0, 36)); + // File format version 2, from 2008-1-1 - 2009-3-23, v0.9.3 - v1.5.0 + case 2: throw std::string (STRING_TASK_NO_FF2); - Task::status status = line[37] == '+' ? completed - : line[37] == 'X' ? deleted - : line[37] == 'r' ? recurring - : pending; - - set ("status", statusToText (status)); - - size_t openTagBracket = line.find ("["); - size_t closeTagBracket = line.find ("]", openTagBracket); - if (openTagBracket != std::string::npos && - closeTagBracket != std::string::npos) - { - size_t openAttrBracket = line.find ("[", closeTagBracket); - size_t closeAttrBracket = line.find ("]", openAttrBracket); - if (openAttrBracket != std::string::npos && - closeAttrBracket != std::string::npos) - { - std::string tags = line.substr ( - openTagBracket + 1, closeTagBracket - openTagBracket - 1); - std::vector tagSet; - split (tagSet, tags, ' '); - addTags (tagSet); - - std::string attributes = line.substr ( - openAttrBracket + 1, closeAttrBracket - openAttrBracket - 1); - std::vector pairs; - split (pairs, attributes, ' '); - for (size_t i = 0; i < pairs.size (); ++i) - { - std::vector pair; - split (pair, pairs[i], ':'); - if (pair.size () == 2) - set (pair[0], pair[1]); - } - - set ("description", line.substr (closeAttrBracket + 2)); - } - else - throw std::string (STRING_TASK_PARSE_ATT_BRACK); - } - else - throw std::string (STRING_TASK_PARSE_TAG_BRACK); - } - else - throw std::string (STRING_TASK_PARSE_TOO_SHORT); - - removeAnnotations (); - } - break; - - // File format version 3, from 2009.3.23 + // File format version 3, from 2009-3-23 - 2009-05-16, v1.6.0 - v1.7.1 case 3: { if (line.length () > 49) // ^.{36} . \[\] \[\] \[\] \n @@ -646,7 +758,7 @@ void Task::legacyParse (const std::string& line) //////////////////////////////////////////////////////////////////////////////// // The format is: // -// [ : ... ] \n +// [ : ... ] // std::string Task::composeF4 () const { @@ -665,18 +777,19 @@ std::string Task::composeF4 () const } } - ff4 += "]\n"; + ff4 += "]"; return ff4; } //////////////////////////////////////////////////////////////////////////////// -std::string Task::composeJSON (bool include_id /*= false*/) const +std::string Task::composeJSON (bool decorate /*= false*/) const { std::stringstream out; out << "{"; - // ID inclusion is optional, not recommended. - if (include_id) + // ID inclusion is optional, but not a good idea, because it remains correct + // only until the next gc. + if (decorate) out << "\"id\":" << id << ","; // First the non-annotations. @@ -684,14 +797,19 @@ std::string Task::composeJSON (bool include_id /*= false*/) const Task::const_iterator i; for (i = this->begin (); i != this->end (); ++i) { + // Annotations are not written out here. + if (i->first.substr (0, 11) == "annotation_") + continue; + if (attributes_written) out << ","; - Column* column = context.columns[i->first]; + std::string type = Task::attributes[i->first]; + if (type == "") + type = "string"; // Date fields are written as ISO 8601. - if (column && - column->type () == "date") + if (type == "date") { Date d (i->second); out << "\"" @@ -764,11 +882,14 @@ std::string Task::composeJSON (bool include_id /*= false*/) const out << "]"; } +#ifdef PRODUCT_TASKWARRIOR // Include urgency. - out << "," - << "\"urgency\":\"" - << urgency_c () - <<"\""; + if (decorate) + out << "," + << "\"urgency\":\"" + << urgency_c () + <<"\""; +#endif out << "}"; return out.str (); @@ -780,31 +901,6 @@ bool Task::hasAnnotations () const return annotation_count ? true : false; } -//////////////////////////////////////////////////////////////////////////////// -void Task::getAnnotations (std::map & annotations) const -{ - annotations.clear (); - - Task::const_iterator ci; - for (ci = this->begin (); ci != this->end (); ++ci) - if (ci->first.substr (0, 11) == "annotation_") - annotations.insert (*ci); -} - -//////////////////////////////////////////////////////////////////////////////// -void Task::setAnnotations (const std::map & annotations) -{ - // Erase old annotations. - removeAnnotations (); - - std::map ::const_iterator ci; - for (ci = annotations.begin (); ci != annotations.end (); ++ci) - this->insert (*ci); - - annotation_count = annotations.size (); - recalc_urgency = true; -} - //////////////////////////////////////////////////////////////////////////////// // The timestamp is part of the name: // annotation_1234567890:"..." @@ -847,6 +943,32 @@ void Task::removeAnnotations () recalc_urgency = true; } +//////////////////////////////////////////////////////////////////////////////// +void Task::getAnnotations (std::map & annotations) const +{ + annotations.clear (); + + Task::const_iterator ci; + for (ci = this->begin (); ci != this->end (); ++ci) + if (ci->first.substr (0, 11) == "annotation_") + annotations.insert (*ci); +} + +//////////////////////////////////////////////////////////////////////////////// +void Task::setAnnotations (const std::map & annotations) +{ + // Erase old annotations. + removeAnnotations (); + + std::map ::const_iterator ci; + for (ci = annotations.begin (); ci != annotations.end (); ++ci) + this->insert (*ci); + + annotation_count = annotations.size (); + recalc_urgency = true; +} + +#ifdef PRODUCT_TASKWARRIOR //////////////////////////////////////////////////////////////////////////////// void Task::addDependency (int id) { @@ -868,11 +990,6 @@ void Task::addDependency (const std::string& uuid) if (uuid == get ("uuid")) throw std::string (STRING_TASK_DEPEND_ITSELF); - // Check that uuid is resolvable. - int id = context.tdb2.pending.id (uuid); - if (id == 0) - throw format (STRING_TASK_DEPEND_MISS_CREA, id); - // Store the dependency. std::string depends = get ("depends"); if (depends != "") @@ -943,6 +1060,7 @@ void Task::getDependencies (std::vector & all) const all.clear (); split (all, get ("depends"), ','); } +#endif //////////////////////////////////////////////////////////////////////////////// int Task::getTagCount () const @@ -960,26 +1078,27 @@ bool Task::hasTag (const std::string& tag) const if (tag == "BLOCKED") return is_blocked; if (tag == "UNBLOCKED") return !is_blocked; if (tag == "BLOCKING") return is_blocking; +#ifdef PRODUCT_TASKWARRIOR if (tag == "DUE") return is_due (); if (tag == "DUETODAY") return is_duetoday (); if (tag == "TODAY") return is_duetoday (); if (tag == "OVERDUE") return is_overdue (); + if (tag == "WEEK") return is_dueweek (); + if (tag == "MONTH") return is_duemonth (); + if (tag == "YEAR") return is_dueyear (); +#endif if (tag == "ACTIVE") return has ("start"); if (tag == "SCHEDULED") return has ("scheduled"); if (tag == "CHILD") return has ("parent"); if (tag == "UNTIL") return has ("until"); if (tag == "WAITING") return has ("wait"); if (tag == "ANNOTATED") return hasAnnotations (); + if (tag == "PARENT") return has ("mask"); /* TODO YESTERDAY - due yesterday TODO TOMORROW - due tomorrow - TODO WEEK - due this week - TODO MONTH - due this month - TODO YEAR - due this year TODO READY - is ready - TODO WAITING - is waiting - TODO PARENT - is a parent */ // Concrete tags. @@ -1046,6 +1165,7 @@ void Task::removeTag (const std::string& tag) recalc_urgency = true; } +#ifdef PRODUCT_TASKWARRIOR //////////////////////////////////////////////////////////////////////////////// // A UDA is an attribute that has supporting config entries such as a data type: // 'uda..type' @@ -1079,18 +1199,16 @@ void Task::substitute ( std::map annotations; getAnnotations (annotations); - bool sensitive = context.config.getBoolean ("search.case.sensitive"); - // Count the changes, so we know whether to proceed to annotations, after // modifying description. int changes = 0; bool done = false; // Regex support is optional. - if (context.config.getBoolean ("regex")) + if (Task::regex) { // Create the regex. - RX rx (from, sensitive); + RX rx (from, Task::searchCaseSensitive); std::vector start; std::vector end; @@ -1140,7 +1258,7 @@ void Task::substitute ( std::string::size_type pos = 0; int skew = 0; - while ((pos = ::find (description, from, pos, sensitive)) != std::string::npos && !done) + while ((pos = ::find (description, from, pos, Task::searchCaseSensitive)) != std::string::npos && !done) { description.replace (pos + skew, from.length (), to); skew += to.length () - from.length (); @@ -1164,7 +1282,7 @@ void Task::substitute ( { pos = 0; skew = 0; - while ((pos = ::find (i->second, from, pos, sensitive)) != std::string::npos && !done) + while ((pos = ::find (i->second, from, pos, Task::searchCaseSensitive)) != std::string::npos && !done) { i->second.replace (pos + skew, from.length (), to); skew += to.length () - from.length (); @@ -1189,6 +1307,7 @@ void Task::substitute ( recalc_urgency = true; } } +#endif //////////////////////////////////////////////////////////////////////////////// // The purpose of Task::validate is three-fold: @@ -1224,6 +1343,7 @@ void Task::validate (bool applyDefault /* = true */) // Store the derived status. setStatus (status); +#ifdef PRODUCT_TASKWARRIOR // Provide an entry date unless user already specified one. if (!has ("entry")) setEntry (); @@ -1237,30 +1357,63 @@ void Task::validate (bool applyDefault /* = true */) // Override with default.project, if not specified. if (applyDefault && ! has ("project")) { - std::string defaultProject = context.config.get ("default.project"); - if (defaultProject != "" && - context.columns["project"]->validate (defaultProject)) - set ("project", defaultProject); + if (Task::defaultProject != "" && + context.columns["project"]->validate (Task::defaultProject)) + set ("project", Task::defaultProject); } // Override with default.priority, if not specified. if (applyDefault && get ("priority") == "") { - std::string defaultPriority = context.config.get ("default.priority"); - if (defaultPriority != "" && - context.columns["priority"]->validate (defaultPriority)) - set ("priority", defaultPriority); + if (Task::defaultPriority != "" && + context.columns["priority"]->validate (Task::defaultPriority)) + set ("priority", Task::defaultPriority); } // Override with default.due, if not specified. if (applyDefault && get ("due") == "") { - std::string defaultDue = context.config.get ("default.due"); - if (defaultDue != "" && - context.columns["due"]->validate (defaultDue)) - set ("due", Date (defaultDue).toEpoch ()); + if (Task::defaultDue != "" && + context.columns["due"]->validate (Task::defaultDue)) + set ("due", Date (Task::defaultDue).toEpoch ()); } + // If a UDA has a default value in the configuration, + // override with uda.(uda).default, if not specified. + if (applyDefault) + { + // Gather a list of all UDAs with a .default value + std::vector udas; + Config::const_iterator var; + for (var = context.config.begin (); var != context.config.end (); ++var) + { + if (var->first.substr (0, 4) == "uda." && + var->first.find (".default") != std::string::npos) + { + std::string::size_type period = var->first.find ('.', 4); + if (period != std::string::npos) + udas.push_back (var->first.substr (4, period - 4)); + } + } + + if (udas.size ()) + { + // For each of those, setup the default value on the task now, + // of course only if we don't have one on the command line already + std::vector ::iterator uda; + for (uda = udas.begin (); uda != udas.end (); ++uda) + { + std::string type = context.config.get ("uda." + *uda + ".type"); + std::string defVal = context.config.get ("uda." + *uda + ".default"); + + // If the default is empty, and we already have a value, skip it + if (defVal != "" && get (*uda) == "") + set (*uda, defVal); + } + } + } +#endif + // 2) To provide suitable warnings about odd states // Date relationships. @@ -1303,8 +1456,10 @@ void Task::validate (bool applyDefault /* = true */) } } +//////////////////////////////////////////////////////////////////////////////// void Task::validate_before (const std::string& left, const std::string& right) { +#ifdef PRODUCT_TASKWARRIOR if (has (left) && has (right)) { @@ -1314,6 +1469,7 @@ void Task::validate_before (const std::string& left, const std::string& right) if (date_left > date_right) context.footnote (format (STRING_TASK_VALID_BEFORE, left, right)); } +#endif } //////////////////////////////////////////////////////////////////////////////// @@ -1407,39 +1563,40 @@ int Task::determineVersion (const std::string& line) float Task::urgency_c () const { float value = 0.0; - value += fabsf (urgencyPriorityCoefficient) > epsilon ? (urgency_priority () * urgencyPriorityCoefficient) : 0.0; - value += fabsf (urgencyProjectCoefficient) > epsilon ? (urgency_project () * urgencyProjectCoefficient) : 0.0; - value += fabsf (urgencyActiveCoefficient) > epsilon ? (urgency_active () * urgencyActiveCoefficient) : 0.0; - value += fabsf (urgencyScheduledCoefficient) > epsilon ? (urgency_scheduled () * urgencyScheduledCoefficient) : 0.0; - value += fabsf (urgencyWaitingCoefficient) > epsilon ? (urgency_waiting () * urgencyWaitingCoefficient) : 0.0; - value += fabsf (urgencyBlockedCoefficient) > epsilon ? (urgency_blocked () * urgencyBlockedCoefficient) : 0.0; - value += fabsf (urgencyAnnotationsCoefficient) > epsilon ? (urgency_annotations () * urgencyAnnotationsCoefficient) : 0.0; - value += fabsf (urgencyTagsCoefficient) > epsilon ? (urgency_tags () * urgencyTagsCoefficient) : 0.0; - value += fabsf (urgencyNextCoefficient) > epsilon ? (urgency_next () * urgencyNextCoefficient) : 0.0; - value += fabsf (urgencyDueCoefficient) > epsilon ? (urgency_due () * urgencyDueCoefficient) : 0.0; - value += fabsf (urgencyBlockingCoefficient) > epsilon ? (urgency_blocking () * urgencyBlockingCoefficient) : 0.0; - value += fabsf (urgencyAgeCoefficient) > epsilon ? (urgency_age () * urgencyAgeCoefficient) : 0.0; +#ifdef PRODUCT_TASKWARRIOR + value += fabsf (Task::urgencyPriorityCoefficient) > epsilon ? (urgency_priority () * Task::urgencyPriorityCoefficient) : 0.0; + value += fabsf (Task::urgencyProjectCoefficient) > epsilon ? (urgency_project () * Task::urgencyProjectCoefficient) : 0.0; + value += fabsf (Task::urgencyActiveCoefficient) > epsilon ? (urgency_active () * Task::urgencyActiveCoefficient) : 0.0; + value += fabsf (Task::urgencyScheduledCoefficient) > epsilon ? (urgency_scheduled () * Task::urgencyScheduledCoefficient) : 0.0; + value += fabsf (Task::urgencyWaitingCoefficient) > epsilon ? (urgency_waiting () * Task::urgencyWaitingCoefficient) : 0.0; + value += fabsf (Task::urgencyBlockedCoefficient) > epsilon ? (urgency_blocked () * Task::urgencyBlockedCoefficient) : 0.0; + value += fabsf (Task::urgencyAnnotationsCoefficient) > epsilon ? (urgency_annotations () * Task::urgencyAnnotationsCoefficient) : 0.0; + value += fabsf (Task::urgencyTagsCoefficient) > epsilon ? (urgency_tags () * Task::urgencyTagsCoefficient) : 0.0; + value += fabsf (Task::urgencyNextCoefficient) > epsilon ? (urgency_next () * Task::urgencyNextCoefficient) : 0.0; + value += fabsf (Task::urgencyDueCoefficient) > epsilon ? (urgency_due () * Task::urgencyDueCoefficient) : 0.0; + value += fabsf (Task::urgencyBlockingCoefficient) > epsilon ? (urgency_blocking () * Task::urgencyBlockingCoefficient) : 0.0; + value += fabsf (Task::urgencyAgeCoefficient) > epsilon ? (urgency_age () * Task::urgencyAgeCoefficient) : 0.0; -/* +/* // Very useful for debugging urgency problems. std::cout << "# Urgency for " << get ("uuid") << ":\n" - << "# pri " << (urgency_priority () * urgencyPriorityCoefficient) << "\n" - << "# pro " << (urgency_project () * urgencyProjectCoefficient) << "\n" - << "# act " << (urgency_active () * urgencyActiveCoefficient) << "\n" - << "# sch " << (urgency_scheduled () * urgencyScheduledCoefficient) << "\n" - << "# wai " << (urgency_waiting () * urgencyWaitingCoefficient) << "\n" - << "# blk " << (urgency_blocked () * urgencyBlockedCoefficient) << "\n" - << "# ann " << (urgency_annotations () * urgencyAnnotationsCoefficient) << "\n" - << "# tag " << (urgency_tags () * urgencyTagsCoefficient) << "\n" - << "# nex " << (urgency_next () * urgencyNextCoefficient) << "\n" - << "# due " << (urgency_due () * urgencyDueCoefficient) << "\n" - << "# bkg " << (urgency_blocking () * urgencyBlockingCoefficient) << "\n" - << "# age " << (urgency_age () * urgencyAgeCoefficient) << "\n"; + << "# pri " << (urgency_priority () * Task::urgencyPriorityCoefficient) << "\n" + << "# pro " << (urgency_project () * Task::urgencyProjectCoefficient) << "\n" + << "# act " << (urgency_active () * Task::urgencyActiveCoefficient) << "\n" + << "# sch " << (urgency_scheduled () * Task::urgencyScheduledCoefficient) << "\n" + << "# wai " << (urgency_waiting () * Task::urgencyWaitingCoefficient) << "\n" + << "# blk " << (urgency_blocked () * Task::urgencyBlockedCoefficient) << "\n" + << "# ann " << (urgency_annotations () * Task::urgencyAnnotationsCoefficient) << "\n" + << "# tag " << (urgency_tags () * Task::urgencyTagsCoefficient) << "\n" + << "# nex " << (urgency_next () * Task::urgencyNextCoefficient) << "\n" + << "# due " << (urgency_due () * Task::urgencyDueCoefficient) << "\n" + << "# bkg " << (urgency_blocking () * Task::urgencyBlockingCoefficient) << "\n" + << "# age " << (urgency_age () * Task::urgencyAgeCoefficient) << "\n"; */ // Tag- and project-specific coefficients. std::map ::iterator var; - for (var = coefficients.begin (); var != coefficients.end (); ++var) + for (var = Task::coefficients.begin (); var != Task::coefficients.end (); ++var) { if (fabs (var->second) > epsilon) { @@ -1476,6 +1633,7 @@ float Task::urgency_c () const } } } +#endif return value; } @@ -1585,36 +1743,28 @@ float Task::urgency_next () const } //////////////////////////////////////////////////////////////////////////////// +// +// Past Present Future +// Overdue Due Due +// +// -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 days +// +// <-- 1.0 linear 0.2 --> +// capped capped +// +// float Task::urgency_due () const { if (has ("due")) { Date now; Date due (get_date ("due")); - int days_overdue = (now - due) / 86400; - if (days_overdue >= 7) return 1.0; // 7 days ago - else if (days_overdue >= 6) return 0.96; - else if (days_overdue >= 5) return 0.92; - else if (days_overdue >= 4) return 0.88; - else if (days_overdue >= 3) return 0.84; - else if (days_overdue >= 2) return 0.80; - else if (days_overdue >= 1) return 0.76; - else if (days_overdue >= 0) return 0.72; - else if (days_overdue >= -1) return 0.68; - else if (days_overdue >= -2) return 0.64; - else if (days_overdue >= -3) return 0.60; - else if (days_overdue >= -4) return 0.56; - else if (days_overdue >= -5) return 0.52; - else if (days_overdue >= -6) return 0.48; - else if (days_overdue >= -7) return 0.44; - else if (days_overdue >= -8) return 0.40; - else if (days_overdue >= -9) return 0.36; - else if (days_overdue >= -10) return 0.32; - else if (days_overdue >= -11) return 0.28; - else if (days_overdue >= -12) return 0.24; - else if (days_overdue >= -13) return 0.20; - else return 0.16; // two weeks from now + // Map a range of 21 days to the value 0.2 - 1.0 + float days_overdue = (now - due) / 86400.0; + if (days_overdue >= 7.0) return 1.0; // < 1 wk ago + else if (days_overdue >= -14.0) return ((days_overdue + 14.0) * 0.8 / 21.0) + 0.2; + else return 0.2; // > 2 wks } return 0.0; @@ -1627,13 +1777,12 @@ float Task::urgency_age () const Date now; Date entry (get_date ("entry")); - int age = (now - entry) / 86400; // in days - float max = context.config.getReal ("urgency.age.max"); + int age = (now - entry) / 86400; // in days - if (max == 0 || age > max) + if (Task::urgencyAgeMax == 0 || age > Task::urgencyAgeMax) return 1.0; - return (1.0 * age/max); + return (1.0 * age / Task::urgencyAgeMax); } //////////////////////////////////////////////////////////////////////////////// @@ -1646,3 +1795,232 @@ float Task::urgency_blocking () const } //////////////////////////////////////////////////////////////////////////////// +void Task::modify ( + const A3& arguments, + std::string& description) +{ + // Coalesce arguments together into sets to be processed as a batch. + unsigned int pos = 0; + Arg arg; + while ((*this).next_mod_group (arguments, arg, pos)) + { + // Attributes are essentially name:value pairs, and correspond directly + // to stored attributes. + if (arg._category == Arg::cat_attr) + { + std::string name; + std::string value; + A3::extract_attr (arg._raw, name, value); + if (A3::is_attribute (name, name)) // Canonicalize + { + //std::cout << "# Task::modify_task name='" << name << "' value='" << value << "'\n"; + + // Get the column info. + Column* column = context.columns[name]; + + if (value == "") + { + (*this).remove (name); + } + else + { + // Dependencies are used as IDs. + if (name == "depends") + { + // Parse IDs + std::vector deps; + split (deps, value, ','); + + // Apply or remove dendencies in turn. + std::vector ::iterator i; + for (i = deps.begin (); i != deps.end (); i++) + { + bool removal = false; + std::string& dep = *i; + + if (dep[0] == '-') + { + removal = true; + dep = i->substr(1, std::string::npos); + } + + std::vector ids; + // Crude UUID check + if (dep.length () == 36) + { + int id = context.tdb2.pending.id (dep); + ids.push_back (id); + } + else + A3::extract_id (dep, ids); + + std::vector ::iterator id; + for (id = ids.begin (); id != ids.end(); id++) + if (removal) + (*this).removeDependency (*id); + else + (*this).addDependency (*id); + } + } + + // Dates are special, maybe. + else if (column->type () == "date") + { + // All values must be eval'd first. + A3 value_tokens; + value_tokens.capture (value); + value_tokens = value_tokens.postfix (value_tokens.tokenize (value_tokens)); + + E9 e (value_tokens); + std::string result = e.evalExpression ((*this)); + context.debug (std::string ("Eval '") + value + "' --> '" + result + "'"); + + // If the date value is less than 5 years, it is a duration, not a + // date, therefore add 'now'. + long l = (long) strtod (result.c_str (), NULL); + if (labs (l) < 5 * 365 * 86400) + { + Duration dur (value); + Date now; + now += l; + (*this).set (name, now.toEpochString ()); + } + else + { + Date d (result, context.config.get ("dateformat")); + (*this).set (name, d.toEpochString ()); + } + } + + // Durations too. + else if (name == "recur" || + column->type () == "duration") + { + // All values must be eval'd first, in this case, just to catch errors. + A3 value_tokens; + value_tokens.capture (value); + value_tokens = value_tokens.postfix (value_tokens.tokenize (value_tokens)); + + E9 e (value_tokens); + std::string result = e.evalExpression ((*this)); + context.debug (std::string ("Eval '") + value + "' --> '" + result + "'"); + + Duration d (value); + + // Deliberately storing the 'raw' value, which is necessary for + // durations like 'weekday'.. + (*this).set (name, name == "recur" ? value : result); + } + + // Need handling for numeric types, used by UDAs. + else if (column->type () == "numeric") + { + A3 value_tokens; + value_tokens.capture (value); + value_tokens = value_tokens.postfix (value_tokens.tokenize (value_tokens)); + + E9 e (value_tokens); + std::string result = e.evalExpression ((*this)); + context.debug (std::string ("Eval '") + value + "' --> '" + result + "'"); + + Nibbler n (result); + double d; + if (n.getNumber (d) && + n.depleted ()) + (*this).set (name, result); + else + throw format (STRING_UDA_NUMERIC, result); + } + + // Try to use modify method, otherwise just continue to the final option. + else if (column->can_modify ()) + { + // column->modify () contains the logic for the specific column + // and returns the appropriate value for (*this).set () + if (column->validate (value)) + (*this).set (name, column->modify (value)); + else + throw format (STRING_INVALID_MOD, name, value); + } + else + { + // Final default action + if (column->validate (value)) + (*this).set (name, value); + else + throw format (STRING_INVALID_MOD, name, value); + } + + // Warn about deprecated/obsolete attribute usage. + legacyAttributeCheck (name); + } + } + else + throw format (STRING_CMD_ADD_BAD_ATTRIBUTE, name); + } + + // Tags need special handling because they are essentially a vector stored + // in a single string, therefore Task::{add,remove}Tag must be called as + // appropriate. + else if (arg._category == Arg::cat_tag) + { + char type; + std::string value; + A3::extract_tag (arg._raw, type, value); + + if (type == '+') + { + (*this).addTag (value); + feedback_special_tags ((*this), value); + } + else + (*this).removeTag (value); + } + + // Substitutions. + else if (arg._category == Arg::cat_subst) + { + std::string from; + std::string to; + bool global; + A3::extract_subst (arg._raw, from, to, global); + (*this).substitute (from, to, global); + } + + // Anything else is essentially downgraded to 'word' and considered part of + // the description. + else + { + if (description.length ()) + description += " "; + + description += arg._raw; + } + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Special processing for modifications. +bool Task::next_mod_group (const A3& input, Arg& arg, unsigned int& pos) +{ + if (pos < input.size ()) + { + arg = input[pos++]; + + if (arg._raw == "depends") + { + while (pos < input.size () && + (input[pos]._category == Arg::cat_op || + input[pos]._type == Arg::type_number)) + { + arg._raw += input[pos++]._raw; + } + } + + return true; + } + + return false; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/Task.h b/src/Task.h index b7c52ea1d..36ae21bd4 100644 --- a/src/Task.h +++ b/src/Task.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -32,12 +32,32 @@ #include #include #include - - -void initializeUrgencyCoefficients (); +#include class Task : public std::map { +public: + static std::string defaultProject; + static std::string defaultPriority; + static std::string defaultDue; + static bool searchCaseSensitive; + static bool regex; + static std::map attributes; // name -> type + static std::map coefficients; + static float urgencyPriorityCoefficient; + static float urgencyProjectCoefficient; + static float urgencyActiveCoefficient; + static float urgencyScheduledCoefficient; + static float urgencyWaitingCoefficient; + static float urgencyBlockedCoefficient; + static float urgencyAnnotationsCoefficient; + static float urgencyTagsCoefficient; + static float urgencyNextCoefficient; + static float urgencyDueCoefficient; + static float urgencyBlockingCoefficient; + static float urgencyAgeCoefficient; + static float urgencyAgeMax; + public: Task (); // Default constructor Task (const Task&); // Copy constructor @@ -48,7 +68,7 @@ public: void parse (const std::string&); std::string composeF4 () const; - std::string composeJSON (bool include_id = false) const; + std::string composeJSON (bool decorate = false) const; // Status values. enum status {pending, completed, deleted, recurring, waiting}; @@ -83,9 +103,14 @@ public: void set (const std::string&, int); void remove (const std::string&); +#ifdef PRODUCT_TASKWARRIOR bool is_due () const; bool is_duetoday () const; + bool is_dueweek () const; + bool is_duemonth () const; + bool is_dueyear () const; bool is_overdue () const; +#endif status getStatus () const; void setStatus (status); @@ -103,6 +128,7 @@ public: void addAnnotation (const std::string&); void removeAnnotations (); +#ifdef PRODUCT_TASKWARRIOR void addDependency (int); void addDependency (const std::string&); void removeDependency (int); @@ -114,15 +140,20 @@ public: void getUDAOrphans (std::vector &) const; void substitute (const std::string&, const std::string&, bool); +#endif void validate (bool applyDefault = true); float urgency_c () const; float urgency (); + void modify (const A3&, std::string&); + bool next_mod_group (const A3&, Arg&, unsigned int&); + private: int determineVersion (const std::string&); - void legacyParse (const std::string&); + void parseJSON (const std::string&); + void parseLegacy (const std::string&); void validate_before (const std::string&, const std::string&); inline float urgency_priority () const; diff --git a/src/Taskmod.cpp b/src/Taskmod.cpp index f6aa24080..55fac47a8 100644 --- a/src/Taskmod.cpp +++ b/src/Taskmod.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -181,10 +182,10 @@ std::string Taskmod::toString () if (_bBeforeSet) { - stream << STRING_TASKMOD_OLD << _before.composeF4(); + stream << STRING_TASKMOD_OLD << _before.composeF4() << "\n"; } - stream << STRING_TASKMOD_NEW << _after.composeF4(); + stream << STRING_TASKMOD_NEW << _after.composeF4() << "\n"; stream << "---\n"; return stream.str (); diff --git a/src/Taskmod.h b/src/Taskmod.h index 8a16f912f..a1b394f4d 100644 --- a/src/Taskmod.h +++ b/src/Taskmod.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/Timer.cpp b/src/Timer.cpp index c106a7408..679d21f8f 100644 --- a/src/Timer.cpp +++ b/src/Timer.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -112,3 +113,40 @@ void Timer::subtract (unsigned long value) } //////////////////////////////////////////////////////////////////////////////// +HighResTimer::HighResTimer () +{ + _start.tv_sec = 0; + _start.tv_usec = 0; + + _stop.tv_sec = 0; + _stop.tv_usec = 0; +} + +//////////////////////////////////////////////////////////////////////////////// +HighResTimer::~HighResTimer () +{ +} + +//////////////////////////////////////////////////////////////////////////////// +void HighResTimer::start () +{ + gettimeofday (&_start, NULL); +} + +//////////////////////////////////////////////////////////////////////////////// +void HighResTimer::stop () +{ + gettimeofday (&_stop, NULL); +} + +//////////////////////////////////////////////////////////////////////////////// +double HighResTimer::total () const +{ + if (_stop.tv_sec > 0 || _stop.tv_usec > 0) + return (_stop.tv_sec - _start.tv_sec) + + (_stop.tv_usec - _start.tv_usec) / 1000000.0; + + return 0.0; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/Timer.h b/src/Timer.h index 5218441a6..5831c7e26 100644 --- a/src/Timer.h +++ b/src/Timer.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -31,6 +31,7 @@ #include #include +// Timer is a scope-activated timer that dumps to std::cout at end of scope. class Timer { public: @@ -52,6 +53,25 @@ private: unsigned long _total; }; +// HighResTimer is a stop watch with microsecond resolution. +class HighResTimer +{ +public: + HighResTimer (); + ~HighResTimer (); + HighResTimer (const HighResTimer&); + HighResTimer& operator= (const HighResTimer&); + + void start (); + void stop (); + double total () const; + +private: + struct timeval _start; + struct timeval _stop; +}; + + #endif //////////////////////////////////////////////////////////////////////////////// diff --git a/src/Transport.cpp b/src/Transport.cpp index 9ac14ab76..f69b0c1bd 100644 --- a/src/Transport.cpp +++ b/src/Transport.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/Transport.h b/src/Transport.h index a09bd84b6..1e8591fb7 100644 --- a/src/Transport.h +++ b/src/Transport.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/TransportCurl.cpp b/src/TransportCurl.cpp index ab5b51839..be6c4fcba 100644 --- a/src/TransportCurl.cpp +++ b/src/TransportCurl.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/TransportCurl.h b/src/TransportCurl.h index 02e2a57ac..538e99180 100644 --- a/src/TransportCurl.h +++ b/src/TransportCurl.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/TransportRSYNC.cpp b/src/TransportRSYNC.cpp index 088bd7d8e..ba82bb617 100644 --- a/src/TransportRSYNC.cpp +++ b/src/TransportRSYNC.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/TransportRSYNC.h b/src/TransportRSYNC.h index d3a560f62..724910888 100644 --- a/src/TransportRSYNC.h +++ b/src/TransportRSYNC.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/TransportSSH.cpp b/src/TransportSSH.cpp index d27bfdd72..e857a0da1 100644 --- a/src/TransportSSH.cpp +++ b/src/TransportSSH.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/TransportSSH.h b/src/TransportSSH.h index 6698cec5c..275a27052 100644 --- a/src/TransportSSH.h +++ b/src/TransportSSH.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/TransportShell.cpp b/src/TransportShell.cpp index f2f37d88e..3a4b0e0d6 100644 --- a/src/TransportShell.cpp +++ b/src/TransportShell.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/TransportShell.h b/src/TransportShell.h index a8c2e07e8..8ff0d2a34 100644 --- a/src/TransportShell.h +++ b/src/TransportShell.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/Uri.cpp b/src/Uri.cpp index 18c3a95c1..5522fc4f4 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/Uri.h b/src/Uri.h index 329ea3680..63ad92cff 100644 --- a/src/Uri.h +++ b/src/Uri.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/ViewTask.cpp b/src/ViewTask.cpp index d1b0c0380..0786a53d1 100644 --- a/src/ViewTask.cpp +++ b/src/ViewTask.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/ViewTask.h b/src/ViewTask.h index 2010b45da..6f21861aa 100644 --- a/src/ViewTask.h +++ b/src/ViewTask.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/ViewText.cpp b/src/ViewText.cpp index 7db106427..6e3ee0056 100644 --- a/src/ViewText.cpp +++ b/src/ViewText.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/ViewText.h b/src/ViewText.h index 76cc5c93f..435325ca9 100644 --- a/src/ViewText.h +++ b/src/ViewText.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColDate.cpp b/src/columns/ColDate.cpp index ae4217cb4..db82fd60f 100644 --- a/src/columns/ColDate.cpp +++ b/src/columns/ColDate.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// -#include +#include #include #include #include @@ -49,6 +49,8 @@ ColumnDate::ColumnDate () _styles.push_back ("epoch"); _styles.push_back ("iso"); _styles.push_back ("age"); + _styles.push_back ("remaining"); + _styles.push_back ("countdown"); Date now; now -= 125; // So that "age" is non-zero. @@ -57,6 +59,8 @@ ColumnDate::ColumnDate () _examples.push_back (now.toEpochString ()); _examples.push_back (now.toISO ()); _examples.push_back (OldDuration (Date () - now).formatCompact ()); + _examples.push_back (""); + _examples.push_back (OldDuration (Date () - now).format ()); } //////////////////////////////////////////////////////////////////////////////// @@ -78,7 +82,7 @@ void ColumnDate::measure (Task& task, unsigned int& minimum, unsigned int& maxim if (task.has (_name)) { - Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)); + Date date (task.get_date (_name)); if (_style == "default" || _style == "formatted") @@ -97,7 +101,6 @@ void ColumnDate::measure (Task& task, unsigned int& minimum, unsigned int& maxim } else if (_style == "countdown") { - Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)); Date now; minimum = maximum = OldDuration (now - date).format ().length (); } @@ -118,6 +121,12 @@ void ColumnDate::measure (Task& task, unsigned int& minimum, unsigned int& maxim Date now; minimum = maximum = OldDuration (now - date).formatCompact ().length (); } + else if (_style == "remaining") + { + Date now; + if (date > now) + minimum = maximum = Duration (date - now).format ().length (); + } else throw format (STRING_COLUMN_BAD_FORMAT, _name, _style); } @@ -132,6 +141,8 @@ void ColumnDate::render ( { if (task.has (_name)) { + Date date (task.get_date (_name)); + if (_style == "default" || _style == "formatted") { @@ -148,12 +159,10 @@ void ColumnDate::render ( lines.push_back ( color.colorize ( leftJustify ( - Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)) - .toString (format), width))); + date.toString (format), width))); } else if (_style == "countdown") { - Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)); Date now; lines.push_back ( @@ -166,28 +175,24 @@ void ColumnDate::render ( lines.push_back ( color.colorize ( rightJustify ( - format (Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)) - .toJulian (), 13, 12), width))); + format (date.toJulian (), 13, 12), width))); } else if (_style == "epoch") { lines.push_back ( color.colorize ( rightJustify ( - Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)) - .toEpochString (), width))); + date.toEpochString (), width))); } else if (_style == "iso") { lines.push_back ( color.colorize ( leftJustify ( - Date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)) - .toISO (), width))); + date.toISO (), width))); } else if (_style == "age") { - Date date ((time_t) strtol (task.get (_name).c_str (), NULL, 10)); Date now; lines.push_back ( @@ -195,6 +200,17 @@ void ColumnDate::render ( leftJustify ( OldDuration (now - date).formatCompact (), width))); } + else if (_style == "remaining") + { + Date now; + if (date > now) + lines.push_back ( + color.colorize ( + rightJustify ( + Duration (date - now).format (), width))); + else + lines.push_back (""); + } } } diff --git a/src/columns/ColDate.h b/src/columns/ColDate.h index 4cd8bd61e..498b5fe05 100644 --- a/src/columns/ColDate.h +++ b/src/columns/ColDate.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColDepends.cpp b/src/columns/ColDepends.cpp index 7ac847545..4367be45d 100644 --- a/src/columns/ColDepends.cpp +++ b/src/columns/ColDepends.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColDepends.h b/src/columns/ColDepends.h index 6f55a9e3e..125ad3c51 100644 --- a/src/columns/ColDepends.h +++ b/src/columns/ColDepends.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColDescription.cpp b/src/columns/ColDescription.cpp index 7192ba65a..0828d6c56 100644 --- a/src/columns/ColDescription.cpp +++ b/src/columns/ColDescription.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColDescription.h b/src/columns/ColDescription.h index 24446afc7..a46526c8e 100644 --- a/src/columns/ColDescription.h +++ b/src/columns/ColDescription.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColDue.cpp b/src/columns/ColDue.cpp index 0528b24f4..90c859ca4 100644 --- a/src/columns/ColDue.cpp +++ b/src/columns/ColDue.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -41,8 +42,6 @@ ColumnDue::ColumnDue () _name = "due"; _label = STRING_COLUMN_LABEL_DUE; - _styles.push_back ("countdown"); - Date now; now += 125; _examples.push_back (OldDuration (now - Date ()).formatCompact ()); diff --git a/src/columns/ColDue.h b/src/columns/ColDue.h index fc3780226..537c74ead 100644 --- a/src/columns/ColDue.h +++ b/src/columns/ColDue.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColEnd.cpp b/src/columns/ColEnd.cpp index 73d793537..b78939a6d 100644 --- a/src/columns/ColEnd.cpp +++ b/src/columns/ColEnd.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include diff --git a/src/columns/ColEnd.h b/src/columns/ColEnd.h index a47fa861d..ebb8bb215 100644 --- a/src/columns/ColEnd.h +++ b/src/columns/ColEnd.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColEntry.cpp b/src/columns/ColEntry.cpp index 0f610357a..8e981aa86 100644 --- a/src/columns/ColEntry.cpp +++ b/src/columns/ColEntry.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include diff --git a/src/columns/ColEntry.h b/src/columns/ColEntry.h index 3a1e0ce42..7c5be834c 100644 --- a/src/columns/ColEntry.h +++ b/src/columns/ColEntry.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColID.cpp b/src/columns/ColID.cpp index e187f8d54..e6b13df3c 100644 --- a/src/columns/ColID.cpp +++ b/src/columns/ColID.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColID.h b/src/columns/ColID.h index 44aaa391c..d7b6bbfa9 100644 --- a/src/columns/ColID.h +++ b/src/columns/ColID.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColIMask.cpp b/src/columns/ColIMask.cpp index 430d598dd..cfea280ee 100644 --- a/src/columns/ColIMask.cpp +++ b/src/columns/ColIMask.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColIMask.h b/src/columns/ColIMask.h index 78af27973..fee89e106 100644 --- a/src/columns/ColIMask.h +++ b/src/columns/ColIMask.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColMask.cpp b/src/columns/ColMask.cpp index 324476e5a..d85f948e3 100644 --- a/src/columns/ColMask.cpp +++ b/src/columns/ColMask.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColMask.h b/src/columns/ColMask.h index 8db84494b..f31be05ec 100644 --- a/src/columns/ColMask.h +++ b/src/columns/ColMask.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColModified.cpp b/src/columns/ColModified.cpp index e08b9fccd..931f8d46e 100644 --- a/src/columns/ColModified.cpp +++ b/src/columns/ColModified.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include diff --git a/src/columns/ColModified.h b/src/columns/ColModified.h index bdf193354..fe0efefa1 100644 --- a/src/columns/ColModified.h +++ b/src/columns/ColModified.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColParent.cpp b/src/columns/ColParent.cpp index 8b878939b..fb45d304a 100644 --- a/src/columns/ColParent.cpp +++ b/src/columns/ColParent.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColParent.h b/src/columns/ColParent.h index 60bd5b59b..f40cb480a 100644 --- a/src/columns/ColParent.h +++ b/src/columns/ColParent.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColPriority.cpp b/src/columns/ColPriority.cpp index 6c47a9261..4fb3ee7b0 100644 --- a/src/columns/ColPriority.cpp +++ b/src/columns/ColPriority.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -118,3 +119,16 @@ void ColumnPriority::render ( } //////////////////////////////////////////////////////////////////////////////// +std::string ColumnPriority::modify (std::string& value) +{ + return upperCase (value); +} + +//////////////////////////////////////////////////////////////////////////////// +bool ColumnPriority::can_modify () +{ + return true; +} + +//////////////////////////////////////////////////////////////////////////////// + diff --git a/src/columns/ColPriority.h b/src/columns/ColPriority.h index fe107e8f5..22500476e 100644 --- a/src/columns/ColPriority.h +++ b/src/columns/ColPriority.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -44,6 +44,8 @@ public: void setStyle (const std::string&); void measure (Task&, unsigned int&, unsigned int&); void render (std::vector &, Task&, int, Color&); + std::string modify (std::string&); + bool can_modify (); private: }; diff --git a/src/columns/ColProject.cpp b/src/columns/ColProject.cpp index a3f2d15df..00759ceaf 100644 --- a/src/columns/ColProject.cpp +++ b/src/columns/ColProject.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColProject.h b/src/columns/ColProject.h index c87303aab..c34445cb6 100644 --- a/src/columns/ColProject.h +++ b/src/columns/ColProject.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColRecur.cpp b/src/columns/ColRecur.cpp index 843f8909f..3588c3ed0 100644 --- a/src/columns/ColRecur.cpp +++ b/src/columns/ColRecur.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColRecur.h b/src/columns/ColRecur.h index 836b760c6..a0f097ce3 100644 --- a/src/columns/ColRecur.h +++ b/src/columns/ColRecur.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColScheduled.cpp b/src/columns/ColScheduled.cpp index 91180546c..15fa76b4e 100644 --- a/src/columns/ColScheduled.cpp +++ b/src/columns/ColScheduled.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColScheduled.h b/src/columns/ColScheduled.h index 015baac9d..abf9f4db9 100644 --- a/src/columns/ColScheduled.h +++ b/src/columns/ColScheduled.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColStart.cpp b/src/columns/ColStart.cpp index b278decdd..f9e3fd861 100644 --- a/src/columns/ColStart.cpp +++ b/src/columns/ColStart.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColStart.h b/src/columns/ColStart.h index 10281403e..c5d14673e 100644 --- a/src/columns/ColStart.h +++ b/src/columns/ColStart.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColStatus.cpp b/src/columns/ColStatus.cpp index 9f482ab8e..36498aa89 100644 --- a/src/columns/ColStatus.cpp +++ b/src/columns/ColStatus.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColStatus.h b/src/columns/ColStatus.h index d793f2c78..0ac4a772e 100644 --- a/src/columns/ColStatus.h +++ b/src/columns/ColStatus.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColString.cpp b/src/columns/ColString.cpp index eabdb3b34..10d58947c 100644 --- a/src/columns/ColString.cpp +++ b/src/columns/ColString.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColString.h b/src/columns/ColString.h index e708cf03b..bffe8c401 100644 --- a/src/columns/ColString.h +++ b/src/columns/ColString.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColTags.cpp b/src/columns/ColTags.cpp index 7065c2c68..2fd7dd46e 100644 --- a/src/columns/ColTags.cpp +++ b/src/columns/ColTags.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColTags.h b/src/columns/ColTags.h index 19c63cb08..672430f22 100644 --- a/src/columns/ColTags.h +++ b/src/columns/ColTags.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColUDA.cpp b/src/columns/ColUDA.cpp index 839916bb8..da66b304d 100644 --- a/src/columns/ColUDA.cpp +++ b/src/columns/ColUDA.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColUDA.h b/src/columns/ColUDA.h index c32eb3469..4c0ad04d8 100644 --- a/src/columns/ColUDA.h +++ b/src/columns/ColUDA.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColUUID.cpp b/src/columns/ColUUID.cpp index 01b219275..b0f213508 100644 --- a/src/columns/ColUUID.cpp +++ b/src/columns/ColUUID.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColUUID.h b/src/columns/ColUUID.h index b021da990..f3e714a59 100644 --- a/src/columns/ColUUID.h +++ b/src/columns/ColUUID.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColUntil.cpp b/src/columns/ColUntil.cpp index 425cf6779..5c4b96bbf 100644 --- a/src/columns/ColUntil.cpp +++ b/src/columns/ColUntil.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include diff --git a/src/columns/ColUntil.h b/src/columns/ColUntil.h index f04adadfc..e810fd2f2 100644 --- a/src/columns/ColUntil.h +++ b/src/columns/ColUntil.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColUrgency.cpp b/src/columns/ColUrgency.cpp index cbfb752be..415e41b3b 100644 --- a/src/columns/ColUrgency.cpp +++ b/src/columns/ColUrgency.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/columns/ColUrgency.h b/src/columns/ColUrgency.h index 5ac183502..a85ceaa1b 100644 --- a/src/columns/ColUrgency.h +++ b/src/columns/ColUrgency.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/ColWait.cpp b/src/columns/ColWait.cpp index f2b8ca909..2cb1726d9 100644 --- a/src/columns/ColWait.cpp +++ b/src/columns/ColWait.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include diff --git a/src/columns/ColWait.h b/src/columns/ColWait.h index 7c62168bd..627ce9fed 100644 --- a/src/columns/ColWait.h +++ b/src/columns/ColWait.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index d666c0fb2..cf01c1958 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -151,17 +152,15 @@ void Column::uda (std::map & all) { // For each UDA, instantiate and initialize ColumnUDA(). std::map udas; - std::vector names; - context.config.all (names); - std::vector ::iterator i; - for (i = names.begin (); i != names.end (); ++i) + Config::const_iterator i; + for (i = context.config.begin (); i != context.config.end (); ++i) { - if (i->substr (0, 4) == "uda.") + if (i->first.substr (0, 4) == "uda.") { std::string::size_type period = 4; - if ((period = i->find ('.', period)) != std::string::npos) - udas[i->substr (4, period - 4)] = 0; + if ((period = i->first.find ('.', period)) != std::string::npos) + udas[i->first.substr (4, period - 4)] = 0; } } @@ -324,3 +323,17 @@ void Column::render (std::vector &, Task&, int, Color&) } //////////////////////////////////////////////////////////////////////////////// +// No L10N. +bool Column::can_modify () +{ + return false; +} + +//////////////////////////////////////////////////////////////////////////////// +// No L10N. +std::string Column::modify (std::string& value) +{ + throw std::string ("Virtual method Column::modify not overridden."); +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/Column.h b/src/columns/Column.h index 6221cebad..0c0c8907c 100644 --- a/src/columns/Column.h +++ b/src/columns/Column.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -64,6 +64,8 @@ public: virtual void renderHeader (std::vector &, int, Color&); virtual void render (std::vector &, const std::string&, int, Color&); virtual void render (std::vector &, Task&, int, Color&); + virtual bool can_modify (); + virtual std::string modify (std::string&); protected: std::string _name; diff --git a/src/commands/CMakeLists.txt b/src/commands/CMakeLists.txt index 61f1e36b8..781330642 100644 --- a/src/commands/CMakeLists.txt +++ b/src/commands/CMakeLists.txt @@ -27,6 +27,7 @@ set (commands_SRCS Command.cpp Command.h CmdEdit.cpp CmdEdit.h CmdExec.cpp CmdExec.h CmdExport.cpp CmdExport.h + CmdGet.cpp CmdGet.h CmdHelp.cpp CmdHelp.h CmdHistory.cpp CmdHistory.h CmdIDs.cpp CmdIDs.h diff --git a/src/commands/CmdAdd.cpp b/src/commands/CmdAdd.cpp index 7cd1a5bde..e83078a1a 100644 --- a/src/commands/CmdAdd.cpp +++ b/src/commands/CmdAdd.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdAdd.h b/src/commands/CmdAdd.h index 41e6f906e..3e428085a 100644 --- a/src/commands/CmdAdd.h +++ b/src/commands/CmdAdd.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdAliases.cpp b/src/commands/CmdAliases.cpp index d03c00b3d..79571c4fa 100644 --- a/src/commands/CmdAliases.cpp +++ b/src/commands/CmdAliases.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdAliases.h b/src/commands/CmdAliases.h index 58f4034c8..a2fa56545 100644 --- a/src/commands/CmdAliases.h +++ b/src/commands/CmdAliases.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdAnnotate.cpp b/src/commands/CmdAnnotate.cpp index b645e232e..c6f8440bd 100644 --- a/src/commands/CmdAnnotate.cpp +++ b/src/commands/CmdAnnotate.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdAnnotate.h b/src/commands/CmdAnnotate.h index 7b21eff0b..73e2d4a9b 100644 --- a/src/commands/CmdAnnotate.h +++ b/src/commands/CmdAnnotate.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdAppend.cpp b/src/commands/CmdAppend.cpp index ee44c718d..d23c8ce3d 100644 --- a/src/commands/CmdAppend.cpp +++ b/src/commands/CmdAppend.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdAppend.h b/src/commands/CmdAppend.h index 17471bff6..d388f130d 100644 --- a/src/commands/CmdAppend.h +++ b/src/commands/CmdAppend.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdBurndown.cpp b/src/commands/CmdBurndown.cpp index 55d97d425..b87d5212f 100644 --- a/src/commands/CmdBurndown.cpp +++ b/src/commands/CmdBurndown.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdBurndown.h b/src/commands/CmdBurndown.h index 182519012..03a1fe8f0 100644 --- a/src/commands/CmdBurndown.h +++ b/src/commands/CmdBurndown.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdCalendar.cpp b/src/commands/CmdCalendar.cpp index b50a40666..bc9570a61 100644 --- a/src/commands/CmdCalendar.cpp +++ b/src/commands/CmdCalendar.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -351,22 +352,19 @@ int CmdCalendar::execute (std::string& output) // Table with holiday information if (context.config.get ("calendar.holidays") == "full") { - std::vector holidays; - context.config.all (holidays); - ViewText holTable; holTable.width (context.getWidth ()); holTable.add (Column::factory ("string", STRING_CMD_CAL_LABEL_DATE)); holTable.add (Column::factory ("string", STRING_CMD_CAL_LABEL_HOL)); - std::vector ::iterator it; + Config::const_iterator it; std::map > hm; // we need to store multiple holidays per day - for (it = holidays.begin (); it != holidays.end (); ++it) - if (it->substr (0, 8) == "holiday.") - if (it->substr (it->size () - 4) == "name") + for (it = context.config.begin (); it != context.config.end (); ++it) + if (it->first.substr (0, 8) == "holiday.") + if (it->first.substr (it->first.size () - 4) == "name") { - std::string holName = context.config.get ("holiday." + it->substr (8, it->size () - 13) + ".name"); - std::string holDate = context.config.get ("holiday." + it->substr (8, it->size () - 13) + ".date"); + std::string holName = context.config.get ("holiday." + it->first.substr (8, it->first.size () - 13) + ".name"); + std::string holDate = context.config.get ("holiday." + it->first.substr (8, it->first.size () - 13) + ".date"); Date hDate (holDate.c_str (), context.config.get ("dateformat.holiday")); if (date_after < hDate && hDate < date_before) @@ -526,14 +524,12 @@ std::string CmdCalendar::renderMonths ( // colorize holidays if (context.config.get ("calendar.holidays") != "none") { - std::vector holidays; - context.config.all (holidays); - std::vector ::iterator hol; - for (hol = holidays.begin (); hol != holidays.end (); ++hol) - if (hol->substr (0, 8) == "holiday.") - if (hol->substr (hol->size () - 4) == "date") + Config::const_iterator hol; + for (hol = context.config.begin (); hol != context.config.end (); ++hol) + if (hol->first.substr (0, 8) == "holiday.") + if (hol->first.substr (hol->first.size () - 4) == "date") { - std::string value = context.config.get (*hol); + std::string value = hol->second; Date holDate (value.c_str (), context.config.get ("dateformat.holiday")); if (holDate.day () == d && holDate.month () == months[mpl] && diff --git a/src/commands/CmdCalendar.h b/src/commands/CmdCalendar.h index feca380f3..adbf800a4 100644 --- a/src/commands/CmdCalendar.h +++ b/src/commands/CmdCalendar.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdColor.cpp b/src/commands/CmdColor.cpp index 874ae6297..66c07803d 100644 --- a/src/commands/CmdColor.cpp +++ b/src/commands/CmdColor.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -69,27 +70,24 @@ int CmdColor::execute (std::string& output) { out << "\n" << STRING_CMD_COLOR_HERE << "\n"; - std::vector all; - context.config.all (all); - ViewText view; view.width (context.getWidth ()); view.add (Column::factory ("string", STRING_CMD_COLOR_COLOR)); view.add (Column::factory ("string", STRING_CMD_COLOR_DEFINITION)); - std::vector ::iterator item; - for (item = all.begin (); item != all.end (); ++item) + Config::const_iterator item; + for (item = context.config.begin (); item != context.config.end (); ++item) { // Skip items with 'color' in their name, that are not referring to // actual colors. - if (*item != "_forcecolor" && - *item != "color" && - item->find ("color") == 0) + if (item->first != "_forcecolor" && + item->first != "color" && + item->first.find ("color") == 0) { - Color color (context.config.get (*item)); + Color color (context.config.get (item->first)); int row = view.addRow (); - view.set (row, 0, *item, color); - view.set (row, 1, context.config.get (*item), color); + view.set (row, 0, item->first, color); + view.set (row, 1, item->second, color); } } diff --git a/src/commands/CmdColor.h b/src/commands/CmdColor.h index 835a4dae8..7f540c733 100644 --- a/src/commands/CmdColor.h +++ b/src/commands/CmdColor.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdColumns.cpp b/src/commands/CmdColumns.cpp index 55db550d3..0327a4206 100644 --- a/src/commands/CmdColumns.cpp +++ b/src/commands/CmdColumns.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdColumns.h b/src/commands/CmdColumns.h index fda90aa4f..ae5bd32c4 100644 --- a/src/commands/CmdColumns.h +++ b/src/commands/CmdColumns.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdCommands.cpp b/src/commands/CmdCommands.cpp index 59fe63291..83488b6b1 100644 --- a/src/commands/CmdCommands.cpp +++ b/src/commands/CmdCommands.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdCommands.h b/src/commands/CmdCommands.h index a9e69a57a..1d0227a29 100644 --- a/src/commands/CmdCommands.h +++ b/src/commands/CmdCommands.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdConfig.cpp b/src/commands/CmdConfig.cpp index fc51b9ba7..fe547aa72 100644 --- a/src/commands/CmdConfig.cpp +++ b/src/commands/CmdConfig.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,9 +25,11 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include +#include #include #include #include @@ -102,9 +104,9 @@ int CmdConfig::execute (std::string& output) if (confirm (format (STRING_CMD_CONFIG_CONFIRM, name, context.config.get (name), value))) { if (comment != std::string::npos) - *line = name + "=" + value + " " + line->substr (comment); + *line = name + "=" + json::encode (value) + " " + line->substr (comment); else - *line = name + "=" + value; + *line = name + "=" + json::encode (value); change = true; } @@ -115,7 +117,7 @@ int CmdConfig::execute (std::string& output) if (!found && confirm (format (STRING_CMD_CONFIG_CONFIRM2, name, value))) { - contents.push_back (name + "=" + value); + contents.push_back (name + "=" + json::encode (value)); change = true; } } diff --git a/src/commands/CmdConfig.h b/src/commands/CmdConfig.h index 8df1bb08b..140726661 100644 --- a/src/commands/CmdConfig.h +++ b/src/commands/CmdConfig.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdCount.cpp b/src/commands/CmdCount.cpp index 7f5cb00cd..d51241271 100644 --- a/src/commands/CmdCount.cpp +++ b/src/commands/CmdCount.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdCount.h b/src/commands/CmdCount.h index 0f92e8683..07b27af75 100644 --- a/src/commands/CmdCount.h +++ b/src/commands/CmdCount.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdCustom.cpp b/src/commands/CmdCustom.cpp index 8a6715e2a..ed45dbe6f 100644 --- a/src/commands/CmdCustom.cpp +++ b/src/commands/CmdCustom.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdCustom.h b/src/commands/CmdCustom.h index b3ccae45c..7b8c5e185 100644 --- a/src/commands/CmdCustom.h +++ b/src/commands/CmdCustom.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdDelete.cpp b/src/commands/CmdDelete.cpp index e48586297..aef086789 100644 --- a/src/commands/CmdDelete.cpp +++ b/src/commands/CmdDelete.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdDelete.h b/src/commands/CmdDelete.h index 404ed675d..7a850acc9 100644 --- a/src/commands/CmdDelete.h +++ b/src/commands/CmdDelete.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdDenotate.cpp b/src/commands/CmdDenotate.cpp index ab5286ff9..fe8ab8c9c 100644 --- a/src/commands/CmdDenotate.cpp +++ b/src/commands/CmdDenotate.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdDenotate.h b/src/commands/CmdDenotate.h index 36763cbee..6f325e3b9 100644 --- a/src/commands/CmdDenotate.h +++ b/src/commands/CmdDenotate.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index 54620b378..0168df525 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -34,8 +35,9 @@ #include #include #include -#include +#ifdef HAVE_COMMIT #include +#endif #ifdef HAVE_LIBGNUTLS #include @@ -136,7 +138,9 @@ int CmdDiagnostics::execute (std::string& output) // Build date. << " " << STRING_CMD_DIAG_BUILT << ": " << __DATE__ << " " << __TIME__ << "\n" +#ifdef HAVE_COMMIT << " " << STRING_CMD_DIAG_COMMIT << ": " << COMMIT << "\n" +#endif << " CMake: " << CMAKE_VERSION << "\n" << " " << STRING_CMD_DIAG_CAPS << ":" #ifdef HAVE_LIBPTHREAD @@ -145,24 +149,6 @@ int CmdDiagnostics::execute (std::string& output) << " -pthreads" #endif -#ifdef HAVE_SRANDOM - << " +srandom" -#else - << " -srandom" -#endif - -#ifdef HAVE_RANDOM - << " +random" -#else - << " -random" -#endif - -#ifdef HAVE_UUID - << " +uuid" -#else - << " -uuid" -#endif - #ifdef HAVE_LIBGNUTLS << " +tls" #else @@ -171,12 +157,10 @@ int CmdDiagnostics::execute (std::string& output) << "\n"; out << " libuuid: " -#if defined (HAVE_UUID) and defined (HAVE_UUID_UNPARSE_LOWER) +#ifdef HAVE_UUID_UNPARSE_LOWER << "libuuid + uuid_unparse_lower" -#elif defined (HAVE_UUID) and !defined (HAVE_UUID_UNPARSE_LOWER) - << "libuuid, no uuid_unparse_lower" #else - << "n/a" + << "libuuid, no uuid_unparse_lower" #endif << "\n"; @@ -213,16 +197,18 @@ int CmdDiagnostics::execute (std::string& output) << location.mode () << "\n"; - out << " Server: " - << context.config.get ("taskd.server") - << "\n"; - out << " Locking: " << (context.config.getBoolean ("locking") ? STRING_CMD_DIAG_ENABLED : STRING_CMD_DIAG_DISABLED) << "\n"; + out << " GC: " + << (context.config.getBoolean ("gc") + ? STRING_CMD_DIAG_ENABLED + : STRING_CMD_DIAG_DISABLED) + << "\n"; + // Determine rc.editor/$EDITOR/$VISUAL. char* peditor; if (context.config.get ("editor") != "") @@ -232,9 +218,50 @@ int CmdDiagnostics::execute (std::string& output) else if ((peditor = getenv ("EDITOR")) != NULL) out << " $EDITOR: " << peditor << "\n"; - out << "\n"; + out << " Server: " + << context.config.get ("taskd.server") + << "\n"; + + if (context.config.get ("taskd.ca") != "") + out << " CA: " + << context.config.get ("taskd.ca") + << (File (context.config.get ("taskd.ca")).readable () + ? " (readable)" : " (not readable)") + << "\n"; + + if (context.config.get ("taskd.trust") != "") + out << " Trust: override\n"; + + out << " Cert: " + << context.config.get ("taskd.certificate") + << (File (context.config.get ("taskd.certificate")).readable () + ? " (readable)" : " (not readable)") + << "\n"; + + out << " Key: " + << context.config.get ("taskd.key") + << (File (context.config.get ("taskd.key")).readable () + ? " (readable)" : " (not readable)") + << "\n"; + + out << " Ciphers: " + << context.config.get ("taskd.ciphers") + << "\n"; + + // Get credentials, but mask out the key. + std::string credentials = context.config.get ("taskd.credentials"); + std::string::size_type last_slash = credentials.rfind ('/'); + if (last_slash != std::string::npos) + credentials = credentials.substr (0, last_slash) + + "/" + + std::string (credentials.length () - last_slash - 1, '*'); + + out << " Creds: " + << credentials + << "\n\n"; // External commands. + // Deprecated in 2.3.0 with push, pull, merge. out << bold.colorize (STRING_CMD_DIAG_EXTERNAL) << "\n"; { @@ -296,24 +323,6 @@ int CmdDiagnostics::execute (std::string& output) out << bold.colorize (STRING_CMD_DIAG_TESTS) << "\n"; { - out << " UUID gen: "; - std::vector uuids; - std::string id; - for (int i = 0; i < 1000; i++) - { - id = uuid (); - if (std::find (uuids.begin (), uuids.end (), id) != uuids.end ()) - { - out << format (STRING_CMD_DIAG_UUID_BAD, i) << "\n"; - break; - } - else - uuids.push_back (id); - } - - if (uuids.size () >= 1000) - out << STRING_CMD_DIAG_UUID_GOOD << "\n"; - // Determine terminal details. const char* term = getenv ("TERM"); out << " $TERM: " diff --git a/src/commands/CmdDiagnostics.h b/src/commands/CmdDiagnostics.h index 22fca488c..5bc5a89a7 100644 --- a/src/commands/CmdDiagnostics.h +++ b/src/commands/CmdDiagnostics.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdDone.cpp b/src/commands/CmdDone.cpp index f3cbafffa..a5c108447 100644 --- a/src/commands/CmdDone.cpp +++ b/src/commands/CmdDone.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdDone.h b/src/commands/CmdDone.h index 334d8b2b2..6154f8259 100644 --- a/src/commands/CmdDone.h +++ b/src/commands/CmdDone.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdDuplicate.cpp b/src/commands/CmdDuplicate.cpp index 515367f2a..ed2d1499e 100644 --- a/src/commands/CmdDuplicate.cpp +++ b/src/commands/CmdDuplicate.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdDuplicate.h b/src/commands/CmdDuplicate.h index 15c906103..1861acb8f 100644 --- a/src/commands/CmdDuplicate.h +++ b/src/commands/CmdDuplicate.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 4bbb948f5..f5f6c612a 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -658,20 +659,10 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string std::vector ::iterator dep; for (dep = dependencies.begin (); dep != dependencies.end (); ++dep) { - std::vector ids; - - // Crude UUID check - if (dep->length () == 36) - { - int id = context.tdb2.pending.id (*dep); - ids.push_back (id); - } + if (dep->length () >= 7) + task.addDependency (*dep); else - A3::extract_id (*dep, ids); - - std::vector ::iterator id; - for (id = ids.begin (); id != ids.end(); id++) - task.addDependency (*id); + task.addDependency ((int) strtol (dep->c_str (), NULL, 10)); } // UDAs diff --git a/src/commands/CmdEdit.h b/src/commands/CmdEdit.h index 4b45c259c..f41301ad6 100644 --- a/src/commands/CmdEdit.h +++ b/src/commands/CmdEdit.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdExec.cpp b/src/commands/CmdExec.cpp index 79979b41f..c2fcda1d4 100644 --- a/src/commands/CmdExec.cpp +++ b/src/commands/CmdExec.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdExec.h b/src/commands/CmdExec.h index 168a6c6c0..f22be71c5 100644 --- a/src/commands/CmdExec.h +++ b/src/commands/CmdExec.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdExport.cpp b/src/commands/CmdExport.cpp index a1fdb26ca..b77ae0fef 100644 --- a/src/commands/CmdExport.cpp +++ b/src/commands/CmdExport.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdExport.h b/src/commands/CmdExport.h index 3df39a1d4..2607da066 100644 --- a/src/commands/CmdExport.h +++ b/src/commands/CmdExport.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdGet.cpp b/src/commands/CmdGet.cpp new file mode 100644 index 000000000..d604caf60 --- /dev/null +++ b/src/commands/CmdGet.cpp @@ -0,0 +1,69 @@ +//////////////////////////////////////////////////////////////////////////////// +// taskwarrior - a command line task list manager. +// +// Copyright 2006-2014, 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 +#include +#include +#include +#include +#include + +extern Context context; + +//////////////////////////////////////////////////////////////////////////////// +CmdGet::CmdGet () +{ + _keyword = "_get"; + _usage = "task _get [ ...]"; + _description = STRING_CMD_GET_USAGE; + _read_only = true; + _displays_id = false; +} + +//////////////////////////////////////////////////////////////////////////////// +int CmdGet::execute (std::string& output) +{ + // Obtain the arguments from the description. That way, things like '--' + // have already been handled. + std::vector words = context.a3.extract_words (); + if (words.size () == 0) + throw std::string (STRING_CMD_GET_NO_DOM); + + std::vector results; + std::vector ::iterator word; + for (word = words.begin (); word != words.end (); ++word) + { + Task t; + results.push_back (context.dom.get (*word, t)); + } + + join (output, " ", results); + output += "\n"; + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/src/Socket.h b/src/commands/CmdGet.h similarity index 68% rename from src/Socket.h rename to src/commands/CmdGet.h index c9f491029..56fd397fe 100644 --- a/src/Socket.h +++ b/src/commands/CmdGet.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,48 +25,18 @@ // //////////////////////////////////////////////////////////////////////////////// -#ifndef INCLUDED_SOCKET -#define INCLUDED_SOCKET +#ifndef INCLUDED_CMDGET +#define INCLUDED_CMDGET #include -#include -#include -#include -#include -#include -#include +#include -class Socket +class CmdGet : public Command { public: - Socket (); - Socket (int); - ~Socket (); - - // Client - void connect (const std::string&, const std::string&); - - // Server - void bind (const std::string&); - void listen (int queue = 5); - int accept (); - void read (std::string&); - void write (const std::string&); - - void close (); - - void limit (int); - void debug (); - -private: - void* get_in_addr (struct sockaddr*); - -private: - int _socket; - int _limit; - bool _debug; + CmdGet (); + int execute (std::string&); }; #endif - //////////////////////////////////////////////////////////////////////////////// diff --git a/src/commands/CmdHelp.cpp b/src/commands/CmdHelp.cpp index 2a6585987..908395c98 100644 --- a/src/commands/CmdHelp.cpp +++ b/src/commands/CmdHelp.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdHelp.h b/src/commands/CmdHelp.h index e3091bc42..3d4b3518a 100644 --- a/src/commands/CmdHelp.h +++ b/src/commands/CmdHelp.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdHistory.cpp b/src/commands/CmdHistory.cpp index ea260874f..bed3f4c55 100644 --- a/src/commands/CmdHistory.cpp +++ b/src/commands/CmdHistory.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdHistory.h b/src/commands/CmdHistory.h index 4774dc3b0..e19e73979 100644 --- a/src/commands/CmdHistory.h +++ b/src/commands/CmdHistory.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdIDs.cpp b/src/commands/CmdIDs.cpp index 3039f0df9..c68ebf231 100644 --- a/src/commands/CmdIDs.cpp +++ b/src/commands/CmdIDs.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdIDs.h b/src/commands/CmdIDs.h index eee2679d6..744000312 100644 --- a/src/commands/CmdIDs.h +++ b/src/commands/CmdIDs.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdImport.cpp b/src/commands/CmdImport.cpp index 046301513..4ed54bbcc 100644 --- a/src/commands/CmdImport.cpp +++ b/src/commands/CmdImport.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -98,121 +99,15 @@ int CmdImport::execute (std::string& output) continue; // Parse the whole thing. - json::value* root = json::parse (object); - if (root->type () == json::j_object) - { - json::object* root_obj = (json::object*)root; - Task task; + Task task (object); - // For each object element... - json_object_iter i; - for (i = root_obj->_data.begin (); - i != root_obj->_data.end (); - ++i) - { - // If the attribute is a recognized column. - Column* col = context.columns[i->first]; - if (col) - { - // Any specified id is ignored. - if (i->first == "id") - ; - - // Urgency, if present, is ignored. - else if (i->first == "urgency") - ; - - // Dates are converted from ISO to epoch. - else if (col->type () == "date") - { - Date d (unquoteText (i->second->dump ())); - task.set (i->first, d.toEpochString ()); - } - - // Tags are an array of JSON strings. - else if (i->first == "tags") - { - json::array* tags = (json::array*)i->second; - json_array_iter t; - for (t = tags->_data.begin (); - t != tags->_data.end (); - ++t) - { - json::string* tag = (json::string*)*t; - task.addTag (tag->_data); - } - } - - // Other types are simply added. - else - task.set (i->first, unquoteText (i->second->dump ())); - } - - // Several attributes do not have columns. - // mask - // imask - // parent - // UDA orphans - else - { - // Annotations are an array of JSON objects with 'entry' and - // 'description' values and must be converted. - if (i->first == "annotations") - { - std::map annos; - - json::array* atts = (json::array*)i->second; - json_array_iter annotations; - for (annotations = atts->_data.begin (); - annotations != atts->_data.end (); - ++annotations) - { - json::object* annotation = (json::object*)*annotations; - json::string* when = (json::string*)annotation->_data["entry"]; - json::string* what = (json::string*)annotation->_data["description"]; - - if (! when) - throw format (STRING_CMD_IMPORT_NO_ENTRY, *line); - - if (! what) - throw format (STRING_CMD_IMPORT_NO_DESC, *line); - - std::string name = "annotation_" + Date (when->_data).toEpochString (); - - annos.insert (std::make_pair (name, what->_data)); - } - - task.setAnnotations (annos); - } - - // Attributes without columns are simply added. - else if (i->first == "parent" || - i->first == "mask" || - i->first == "imask") - { - task.set (i->first, unquoteText (i->second->dump ())); - } - - // UDA Orphan - must be preserved. - else - { - task.set (i->first, unquoteText (i->second->dump ())); - } - } - } - - context.tdb2.add (task); - ++count; - std::cout << " " - << task.get ("uuid") - << " " - << task.get ("description") - << "\n"; - } - else - throw format (STRING_CMD_IMPORT_NOT_JSON, *line); - - delete root; + context.tdb2.add (task); + ++count; + std::cout << " " + << task.get ("uuid") + << " " + << task.get ("description") + << "\n"; } } diff --git a/src/commands/CmdImport.h b/src/commands/CmdImport.h index eac0b7f8b..0f2561db0 100644 --- a/src/commands/CmdImport.h +++ b/src/commands/CmdImport.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index 3db4a9bdc..f372da7e6 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdInfo.h b/src/commands/CmdInfo.h index b1b35f6fd..7b87d7131 100644 --- a/src/commands/CmdInfo.h +++ b/src/commands/CmdInfo.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdInstall.cpp b/src/commands/CmdInstall.cpp index 66d8118b6..9808f987f 100644 --- a/src/commands/CmdInstall.cpp +++ b/src/commands/CmdInstall.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdInstall.h b/src/commands/CmdInstall.h index db4a1ae39..121fa003c 100644 --- a/src/commands/CmdInstall.h +++ b/src/commands/CmdInstall.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdLog.cpp b/src/commands/CmdLog.cpp index c21f790f2..25f1ec358 100644 --- a/src/commands/CmdLog.cpp +++ b/src/commands/CmdLog.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdLog.h b/src/commands/CmdLog.h index 78d4d8bd1..e3b46952b 100644 --- a/src/commands/CmdLog.h +++ b/src/commands/CmdLog.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdLogo.cpp b/src/commands/CmdLogo.cpp index 16143d055..dd6378f20 100644 --- a/src/commands/CmdLogo.cpp +++ b/src/commands/CmdLogo.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdLogo.h b/src/commands/CmdLogo.h index 7d99a7d9d..cab22e9a7 100644 --- a/src/commands/CmdLogo.h +++ b/src/commands/CmdLogo.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdMerge.cpp b/src/commands/CmdMerge.cpp index 74abc7409..ad4b55313 100644 --- a/src/commands/CmdMerge.cpp +++ b/src/commands/CmdMerge.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -51,6 +52,8 @@ CmdMerge::CmdMerge () //////////////////////////////////////////////////////////////////////////////// int CmdMerge::execute (std::string& output) { + context.footnote ("The 'merge' command is deprecated, and will be removed in a subsequent release."); + // invoke gc and commit before merging in order to update data files context.tdb2.gc (); context.tdb2.commit (); diff --git a/src/commands/CmdMerge.h b/src/commands/CmdMerge.h index a14120187..a67730f1a 100644 --- a/src/commands/CmdMerge.h +++ b/src/commands/CmdMerge.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdModify.cpp b/src/commands/CmdModify.cpp index 7642f2243..2ca568c6b 100644 --- a/src/commands/CmdModify.cpp +++ b/src/commands/CmdModify.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdModify.h b/src/commands/CmdModify.h index 94b807da0..b63511790 100644 --- a/src/commands/CmdModify.h +++ b/src/commands/CmdModify.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdPrepend.cpp b/src/commands/CmdPrepend.cpp index 3bb88e938..380a1143c 100644 --- a/src/commands/CmdPrepend.cpp +++ b/src/commands/CmdPrepend.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdPrepend.h b/src/commands/CmdPrepend.h index a70db47ae..9dcdbba58 100644 --- a/src/commands/CmdPrepend.h +++ b/src/commands/CmdPrepend.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdProjects.cpp b/src/commands/CmdProjects.cpp index 8cce234bb..8609688ca 100644 --- a/src/commands/CmdProjects.cpp +++ b/src/commands/CmdProjects.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdProjects.h b/src/commands/CmdProjects.h index 918813bf3..21246784a 100644 --- a/src/commands/CmdProjects.h +++ b/src/commands/CmdProjects.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdPull.cpp b/src/commands/CmdPull.cpp index 710654251..fb02844a1 100644 --- a/src/commands/CmdPull.cpp +++ b/src/commands/CmdPull.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -49,6 +50,8 @@ CmdPull::CmdPull () //////////////////////////////////////////////////////////////////////////////// int CmdPull::execute (std::string& output) { + context.footnote ("The 'pull' command is deprecated, and will be removed in a subsequent release."); + std::vector words = context.a3.extract_words (); std::string file; if (words.size ()) diff --git a/src/commands/CmdPull.h b/src/commands/CmdPull.h index 515cf8939..3dfa0532a 100644 --- a/src/commands/CmdPull.h +++ b/src/commands/CmdPull.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdPush.cpp b/src/commands/CmdPush.cpp index 8cdc452b4..adf2f0649 100644 --- a/src/commands/CmdPush.cpp +++ b/src/commands/CmdPush.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -51,6 +52,8 @@ CmdPush::CmdPush () // Because this is potentially on another machine, no checking can be performed. int CmdPush::execute (std::string& output) { + context.footnote ("The 'push' command is deprecated, and will be removed in a subsequent release."); + std::vector words = context.a3.extract_words (); std::string file; if (words.size ()) diff --git a/src/commands/CmdPush.h b/src/commands/CmdPush.h index 3a2a673ab..c5892d216 100644 --- a/src/commands/CmdPush.h +++ b/src/commands/CmdPush.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdReports.cpp b/src/commands/CmdReports.cpp index 6f548da19..88a30b821 100644 --- a/src/commands/CmdReports.cpp +++ b/src/commands/CmdReports.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -51,15 +52,12 @@ int CmdReports::execute (std::string& output) std::vector reports; // Add custom reports. - std::vector vars; - context.config.all (vars); - - std::vector ::iterator i; - for (i = vars.begin (); i != vars.end (); ++i) + Config::const_iterator i; + for (i = context.config.begin (); i != context.config.end (); ++i) { - if (i->substr (0, 7) == "report.") + if (i->first.substr (0, 7) == "report.") { - std::string report = i->substr (7); + std::string report = i->first.substr (7); std::string::size_type columns = report.find (".columns"); if (columns != std::string::npos) reports.push_back (report.substr (0, columns)); diff --git a/src/commands/CmdReports.h b/src/commands/CmdReports.h index 512d29171..fd302de4a 100644 --- a/src/commands/CmdReports.h +++ b/src/commands/CmdReports.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdShow.cpp b/src/commands/CmdShow.cpp index 669ed50c4..688b461ca 100644 --- a/src/commands/CmdShow.cpp +++ b/src/commands/CmdShow.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -133,6 +134,7 @@ int CmdShow::execute (std::string& output) " dateformat.info" " dateformat.report" " debug" + " debug.tls" " default.command" " default.due" " default.priority" @@ -164,14 +166,14 @@ int CmdShow::execute (std::string& output) " list.all.tags" " locale" " locking" - " merge.autopush" - " merge.default.uri" + " merge.autopush" // Deprecated 2.3.0 + " merge.default.uri" // Deprecated 2.3.0 " monthsperline" " nag" " patterns" " print.empty.columns" - " pull.default.uri" - " push.default.uri" + " pull.default.uri" // Deprecated 2.3.0 + " push.default.uri" // Deprecated 2.3.0 " recurrence.indicator" " recurrence.limit" " regex" @@ -185,7 +187,12 @@ int CmdShow::execute (std::string& output) " shell.prompt" " tag.indicator" " taskd.server" + " taskd.ca" + " taskd.certificate" + " taskd.ciphers" " taskd.credentials" + " taskd.key" + " taskd.trust" " undo.style" " urgency.active.coefficient" " urgency.scheduled.coefficient" @@ -210,37 +217,35 @@ int CmdShow::execute (std::string& output) // is redirected to a file, or stdout is not a tty. recognized += "_forcecolor "; - std::vector all; - context.config.all (all); - std::vector unrecognized; - std::vector ::iterator i; - for (i = all.begin (); i != all.end (); ++i) + Config::const_iterator i; + for (i = context.config.begin (); i != context.config.end (); ++i) { // Disallow partial matches by tacking a leading and trailing space on each // variable name. - std::string pattern = " " + *i + " "; + std::string pattern = " " + i->first + " "; if (recognized.find (pattern) == std::string::npos) { // These are special configuration variables, because their name is // dynamic. - if (i->substr (0, 14) != "color.keyword." && - i->substr (0, 14) != "color.project." && - i->substr (0, 10) != "color.tag." && - i->substr (0, 10) != "color.uda." && - i->substr (0, 8) != "holiday." && - i->substr (0, 7) != "report." && - i->substr (0, 6) != "alias." && - i->substr (0, 5) != "hook." && - i->substr (0, 5) != "push." && - i->substr (0, 5) != "pull." && - i->substr (0, 6) != "merge." && - i->substr (0, 4) != "uda." && - i->substr (0, 21) != "urgency.user.project." && - i->substr (0, 17) != "urgency.user.tag." && - i->substr (0, 12) != "urgency.uda.") + if (i->first.substr (0, 14) != "color.keyword." && + i->first.substr (0, 14) != "color.project." && + i->first.substr (0, 10) != "color.tag." && + i->first.substr (0, 10) != "color.uda." && + i->first.substr (0, 8) != "holiday." && + i->first.substr (0, 7) != "report." && + i->first.substr (0, 6) != "alias." && + i->first.substr (0, 5) != "hook." && + i->first.substr (0, 5) != "push." && // Deprecated 2.3.0 + i->first.substr (0, 5) != "pull." && // Deprecated 2.3.0 + i->first.substr (0, 6) != "merge." && // Deprecated 2.3.0 + i->first.substr (0, 4) != "uda." && + i->first.substr (0, 4) != "default." && + i->first.substr (0, 21) != "urgency.user.project." && + i->first.substr (0, 17) != "urgency.user.tag." && + i->first.substr (0, 12) != "urgency.uda.") { - unrecognized.push_back (*i); + unrecognized.push_back (i->first); } } } @@ -250,9 +255,9 @@ int CmdShow::execute (std::string& output) Config default_config; default_config.setDefaults (); - for (i = all.begin (); i != all.end (); ++i) - if (context.config.get (*i) != default_config.get (*i)) - default_values.push_back (*i); + for (i = context.config.begin (); i != context.config.end (); ++i) + if (i->second != default_config.get (i->first)) + default_values.push_back (i->first); // Create output view. ViewText view; @@ -276,37 +281,27 @@ int CmdShow::execute (std::string& output) section = ""; std::string::size_type loc; - for (i = all.begin (); i != all.end (); ++i) + for (i = context.config.begin (); i != context.config.end (); ++i) { - loc = i->find (section, 0); + loc = i->first.find (section, 0); if (loc != std::string::npos) { // Look for unrecognized. Color color; - if (std::find (unrecognized.begin (), unrecognized.end (), *i) != unrecognized.end ()) + if (std::find (unrecognized.begin (), unrecognized.end (), i->first) != unrecognized.end ()) { issue_error = true; color = error; } - else if (std::find (default_values.begin (), default_values.end (), *i) != default_values.end ()) + else if (std::find (default_values.begin (), default_values.end (), i->first) != default_values.end ()) { issue_warning = true; color = warning; } - std::string value = context.config.get (*i); - // hide sensible information - if ( (i->substr (0, 5) == "push." || - i->substr (0, 5) == "pull." || - i->substr (0, 6) == "merge.") && (i->find (".uri") != std::string::npos) ) { - - Uri uri (value); - uri.parse (); - value = uri.ToString (); - } - + std::string value = i->second; int row = view.addRow (); - view.set (row, 0, *i, color); + view.set (row, 0, i->first, color); view.set (row, 1, value, color); } } @@ -331,6 +326,7 @@ int CmdShow::execute (std::string& output) { out << STRING_CMD_SHOW_UNREC << "\n"; + std::vector ::iterator i; for (i = unrecognized.begin (); i != unrecognized.end (); ++i) out << " " << *i << "\n"; @@ -376,7 +372,7 @@ int CmdShow::execute (std::string& output) // Verify installation. This is mentioned in the documentation as the way // to ensure everything is properly installed. - if (all.size () == 0) + if (context.config.size () == 0) { out << STRING_CMD_SHOW_EMPTY << "\n"; rc = 1; diff --git a/src/commands/CmdShow.h b/src/commands/CmdShow.h index f63f145b6..9d636d968 100644 --- a/src/commands/CmdShow.h +++ b/src/commands/CmdShow.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdStart.cpp b/src/commands/CmdStart.cpp index 8e0bd0410..b089f0158 100644 --- a/src/commands/CmdStart.cpp +++ b/src/commands/CmdStart.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdStart.h b/src/commands/CmdStart.h index 1c987cddf..541c30fe7 100644 --- a/src/commands/CmdStart.h +++ b/src/commands/CmdStart.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdStats.cpp b/src/commands/CmdStats.cpp index ec76a9e90..f0655436a 100644 --- a/src/commands/CmdStats.cpp +++ b/src/commands/CmdStats.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -75,7 +76,7 @@ int CmdStats::execute (std::string& output) std::vector backlogTxns = context.tdb2.backlog.get_lines (); int backlogCount = 0; for (tx = backlogTxns.begin (); tx != backlogTxns.end (); ++tx) - if ((*tx)[0] == '[') + if ((*tx)[0] == '{') ++backlogCount; // Get all the tasks. diff --git a/src/commands/CmdStats.h b/src/commands/CmdStats.h index 45440da1e..eb11f726a 100644 --- a/src/commands/CmdStats.h +++ b/src/commands/CmdStats.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdStop.cpp b/src/commands/CmdStop.cpp index 1f6a0f6f5..6acbca6ae 100644 --- a/src/commands/CmdStop.cpp +++ b/src/commands/CmdStop.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdStop.h b/src/commands/CmdStop.h index 439c0a449..fcc6fe562 100644 --- a/src/commands/CmdStop.h +++ b/src/commands/CmdStop.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdSummary.cpp b/src/commands/CmdSummary.cpp index 5b5ed6aac..7b335aad6 100644 --- a/src/commands/CmdSummary.cpp +++ b/src/commands/CmdSummary.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdSummary.h b/src/commands/CmdSummary.h index 583f9a878..c606622ff 100644 --- a/src/commands/CmdSummary.h +++ b/src/commands/CmdSummary.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdSync.cpp b/src/commands/CmdSync.cpp index 93be421e5..72dd848cd 100644 --- a/src/commands/CmdSync.cpp +++ b/src/commands/CmdSync.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2012, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,13 +25,15 @@ // //////////////////////////////////////////////////////////////////////////////// -#include +#include #include #include +#include #include -#include +#include #include #include +#include #include #include @@ -41,7 +43,7 @@ extern Context context; CmdSync::CmdSync () { _keyword = "synchronize"; - _usage = "task synchronize"; + _usage = "task synchronize [initialize]"; _description = STRING_CMD_SYNC_USAGE; _read_only = false; _displays_id = false; @@ -51,17 +53,38 @@ CmdSync::CmdSync () int CmdSync::execute (std::string& output) { int status = 0; - Timer timer_sync; - timer_sync.start (); - +#ifdef HAVE_LIBGNUTLS std::stringstream out; + // Loog for the 'init' keyword to indicate one-time pending.data upload. + bool first_time_init = false; + std::vector words = context.a3.extract_words (); + std::vector ::iterator word; + for (word = words.begin (); word != words.end (); ++word) + { + if (closeEnough ("initialize", *word, 4)) + { + if (!context.config.getBoolean ("confirmation") || + confirm (STRING_CMD_SYNC_INIT)) + first_time_init = true; + else + throw std::string (STRING_CMD_SYNC_NO_INIT); + } + } + // If no server is set up, quit. std::string connection = context.config.get ("taskd.server"); if (connection == "" || connection.rfind (':') == std::string::npos) throw std::string (STRING_CMD_SYNC_NO_SERVER); + // If push/pull/merge is configured, quit. + if (context.config.get ("merge.autopush") != "" || + context.config.get ("merge.default.uri") != "" || + context.config.get ("push.default.uri") != "" || + context.config.get ("pull.default.uri") != "") + throw std::string (STRING_CMD_SYNC_NOMERGE); + // Obtain credentials. std::string credentials_string = context.config.get ("taskd.credentials"); if (credentials_string == "") @@ -72,21 +95,53 @@ int CmdSync::execute (std::string& output) if (credentials.size () != 3) throw std::string (STRING_CMD_SYNC_BAD_CRED); - // Read backlog.data. - std::string payload = ""; - File backlog (context.config.get ("data.location") + "/backlog.data"); - if (backlog.exists ()) - backlog.read (payload); + bool trust = context.config.getBoolean ("taskd.trust"); - // Count the number of tasks being uploaded. + // CA must exist, if provided. + File ca (context.config.get ("taskd.ca")); + if (ca._data != "" && ! ca.exists ()) + throw std::string (STRING_CMD_SYNC_BAD_CA); + + if (trust && ca._data != "") + throw std::string (STRING_CMD_SYNC_TRUST_CA); + + File certificate (context.config.get ("taskd.certificate")); + if (! certificate.exists ()) + throw std::string (STRING_CMD_SYNC_BAD_CERT); + + File key (context.config.get ("taskd.key")); + if (! key.exists ()) + throw std::string (STRING_CMD_SYNC_BAD_KEY); + + // If this is a first-time initialization, send pending.data, not + // backlog.data. + std::string payload = ""; int upload_count = 0; + if (first_time_init) { - std::vector lines; - split (lines, payload, "\n"); + // Delete backlog.data. Because if we're uploading everything, the list of + // deltas is meaningless. + context.tdb2.backlog._file.truncate (); + + std::vector pending = context.tdb2.pending.get_tasks (); + std::vector ::iterator i; + for (i = pending.begin (); i != pending.end (); ++i) + { + payload += i->composeJSON () + "\n"; + ++upload_count; + } + } + else + { + std::vector lines = context.tdb2.backlog.get_lines (); std::vector ::iterator i; for (i = lines.begin (); i != lines.end (); ++i) - if ((*i)[0] == '[') + { + if ((*i)[0] == '{') ++upload_count; + + payload += *i + "\n"; + } } // Send 'sync' + payload. @@ -97,15 +152,22 @@ int CmdSync::execute (std::string& output) request.set ("user", credentials[1]); request.set ("key", credentials[2]); - // TODO Add the other necessary header fields. - request.setPayload (payload); out << format (STRING_CMD_SYNC_PROGRESS, connection) << "\n"; + // Ignore harmful signals. + signal (SIGHUP, SIG_IGN); + signal (SIGINT, SIG_IGN); + signal (SIGKILL, SIG_IGN); + signal (SIGPIPE, SIG_IGN); + signal (SIGTERM, SIG_IGN); + signal (SIGUSR1, SIG_IGN); + signal (SIGUSR2, SIG_IGN); + Msg response; - if (send (connection, request, response)) + if (send (connection, ca._data, certificate._data, key._data, trust, request, response)) { std::string code = response.get ("code"); if (code == "200") @@ -118,15 +180,17 @@ int CmdSync::execute (std::string& output) std::vector lines; split (lines, payload, '\n'); - // TODO This is not necessary if only a synch key was received. - // Load all tasks. - context.tdb2.all_tasks (); + // Load all tasks, but only if necessary. There is always a sync key in + // the payload, so if there are two or more lines, then we have merging + // to perform, otherwise it's just a backlog.data update. + if (lines.size () > 1) + context.tdb2.all_tasks (); - std::string synch_key = ""; + std::string sync_key = ""; std::vector ::iterator line; for (line = lines.begin (); line != lines.end (); ++line) { - if ((*line)[0] == '[') + if ((*line)[0] == '{') { ++download_count; @@ -158,28 +222,29 @@ int CmdSync::execute (std::string& output) } else if (*line != "") { - synch_key = *line; - context.debug ("Synch key " + synch_key); + sync_key = *line; + context.debug ("Sync key " + sync_key); } // Otherwise line is blank, so ignore it. } - // Only update everything if there is a new synch_key. No synch_key means + // Only update everything if there is a new sync_key. No sync_key means // something horrible happened on the other end of the wire. - if (synch_key != "") + if (sync_key != "") { - // Truncate backlog.data, save new synch_key. + // Truncate backlog.data, save new sync_key. context.tdb2.backlog._file.truncate (); context.tdb2.backlog.clear_tasks (); context.tdb2.backlog.clear_lines (); - context.tdb2.backlog.add_line (synch_key + "\n"); + context.tdb2.backlog.add_line (sync_key + "\n"); // Commit all changes. context.tdb2.commit (); // Present a clear status message. if (upload_count == 0 && download_count == 0) + // Note: should not happen - expect code 201 instead. context.footnote (STRING_CMD_SYNC_SUCCESS0); else if (upload_count == 0 && download_count > 0) context.footnote (format (STRING_CMD_SYNC_SUCCESS2, download_count)); @@ -193,6 +258,13 @@ int CmdSync::execute (std::string& output) { context.footnote (STRING_CMD_SYNC_SUCCESS_NOP); } + else if (code == "301") + { + std::string new_server = response.get ("info"); + context.config.set ("taskd.server", new_server); + context.error (STRING_CMD_SYNC_RELOCATE0); + context.error (" " + format (STRING_CMD_SYNC_RELOCATE1, new_server)); + } else if (code == "430") { context.error (STRING_CMD_SYNC_FAIL_ACCOUNT); @@ -206,7 +278,7 @@ int CmdSync::execute (std::string& output) status = 2; } - // Display all errors returned. This is required by the server protocol. + // Display all errors returned. This is recommended by the server protocol. std::string to_be_displayed = response.get ("messages"); if (to_be_displayed != "") { @@ -233,26 +305,33 @@ int CmdSync::execute (std::string& output) out << "\n"; output = out.str (); -/* - timer_sync.stop (); - std::stringstream s; - s << "Sync " - << Date ().toISO () - << " sync:" - << timer_sync.total () - << "\n"; - debug (s.str ()); -*/ + // Restore signal handling. + signal (SIGHUP, SIG_DFL); + signal (SIGINT, SIG_DFL); + signal (SIGKILL, SIG_DFL); + signal (SIGPIPE, SIG_DFL); + signal (SIGTERM, SIG_DFL); + signal (SIGUSR1, SIG_DFL); + signal (SIGUSR2, SIG_DFL); +#else + // Without GnuTLS found at compile time, there is no working sync command. + throw std::string (STRING_CMD_SYNC_NO_TLS); +#endif return status; } //////////////////////////////////////////////////////////////////////////////// bool CmdSync::send ( const std::string& to, + const std::string& ca, + const std::string& certificate, + const std::string& key, + bool trust, const Msg& request, Msg& response) { +#ifdef HAVE_LIBGNUTLS std::string::size_type colon = to.rfind (':'); if (colon == std::string::npos) throw format (STRING_CMD_SYNC_BAD_SERVER, to); @@ -262,13 +341,18 @@ bool CmdSync::send ( try { - Socket s; - s.connect (server, port); - s.write (request.serialize () + "\n"); + TLSClient client; + client.debug (context.config.getInteger ("debug.tls")); + + client.trust (trust); + client.ciphers (context.config.get ("taskd.ciphers")); + client.init (ca, certificate, key); + client.connect (server, port); + client.send (request.serialize () + "\n"); std::string incoming; - s.read (incoming); - s.close (); + client.recv (incoming); + client.bye (); response.parse (incoming); return true; @@ -276,10 +360,11 @@ bool CmdSync::send ( catch (std::string& error) { - context.debug (error); + context.error (error); } // Indicate message failed. +#endif return false; } diff --git a/src/commands/CmdSync.h b/src/commands/CmdSync.h index 074b68d0d..d914b0f0f 100644 --- a/src/commands/CmdSync.h +++ b/src/commands/CmdSync.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -39,7 +39,7 @@ public: int execute (std::string&); private: - bool send (const std::string&, const Msg&, Msg&); + bool send (const std::string&, const std::string&, const std::string&, const std::string&, bool, const Msg&, Msg&); }; #endif diff --git a/src/commands/CmdTags.cpp b/src/commands/CmdTags.cpp index 5910b016e..fc97e5051 100644 --- a/src/commands/CmdTags.cpp +++ b/src/commands/CmdTags.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdTags.h b/src/commands/CmdTags.h index 6affeb0e2..413b540d4 100644 --- a/src/commands/CmdTags.h +++ b/src/commands/CmdTags.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdTimesheet.cpp b/src/commands/CmdTimesheet.cpp index 088adb106..5f5952c98 100644 --- a/src/commands/CmdTimesheet.cpp +++ b/src/commands/CmdTimesheet.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdTimesheet.h b/src/commands/CmdTimesheet.h index ab25f415a..2eb8a6ce7 100644 --- a/src/commands/CmdTimesheet.h +++ b/src/commands/CmdTimesheet.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdUDAs.cpp b/src/commands/CmdUDAs.cpp index 0d9f73f65..02ebf5e80 100644 --- a/src/commands/CmdUDAs.cpp +++ b/src/commands/CmdUDAs.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -53,19 +54,16 @@ int CmdUDAs::execute (std::string& output) int rc = 0; std::stringstream out; - std::vector names; - context.config.all (names); - std::vector udas; - std::vector ::iterator name; - for (name = names.begin (); name != names.end (); ++name) + Config::const_iterator name; + for (name = context.config.begin (); name != context.config.end (); ++name) { - if (name->substr (0, 4) == "uda." && - name->find (".type") != std::string::npos) + if (name->first.substr (0, 4) == "uda." && + name->first.find (".type") != std::string::npos) { - std::string::size_type period = name->find ('.', 4); + std::string::size_type period = name->first.find ('.', 4); if (period != std::string::npos) - udas.push_back (name->substr (4, period - 4)); + udas.push_back (name->first.substr (4, period - 4)); } } @@ -77,13 +75,15 @@ int CmdUDAs::execute (std::string& output) { std::sort (udas.begin (), udas.end ()); - // Render a list of UDA name, type and label. + // Render a list of UDA name, type, label, allowed values, + // possible default value, and finally the usage count. ViewText view; view.width (context.getWidth ()); view.add (Column::factory ("string", STRING_COLUMN_LABEL_UDA)); view.add (Column::factory ("string", STRING_COLUMN_LABEL_TYPE)); view.add (Column::factory ("string", STRING_COLUMN_LABEL_LABEL)); view.add (Column::factory ("string", STRING_COLUMN_LABEL_VALUES)); + view.add (Column::factory ("string", STRING_COLUMN_LABEL_DEFAULT)); view.add (Column::factory ("string", STRING_COLUMN_LABEL_UDACOUNT)); std::vector ::iterator uda; @@ -92,6 +92,7 @@ int CmdUDAs::execute (std::string& output) std::string type = context.config.get ("uda." + *uda + ".type"); std::string label = context.config.get ("uda." + *uda + ".label"); std::string values = context.config.get ("uda." + *uda + ".values"); + std::string defval = context.config.get ("uda." + *uda + ".default"); if (label == "") label = *uda; @@ -107,7 +108,8 @@ int CmdUDAs::execute (std::string& output) view.set (row, 1, type); view.set (row, 2, label); view.set (row, 3, values); - view.set (row, 4, count); + view.set (row, 4, defval); + view.set (row, 5, count); } out << optionalBlankLine () @@ -178,19 +180,16 @@ CmdCompletionUDAs::CmdCompletionUDAs () //////////////////////////////////////////////////////////////////////////////// int CmdCompletionUDAs::execute (std::string& output) { - std::vector names; - context.config.all (names); - std::vector udas; - std::vector ::iterator name; - for (name = names.begin (); name != names.end (); ++name) + Config::const_iterator name; + for (name = context.config.begin (); name != context.config.end (); ++name) { - if (name->substr (0, 4) == "uda." && - name->find (".type") != std::string::npos) + if (name->first.substr (0, 4) == "uda." && + name->first.find (".type") != std::string::npos) { - std::string::size_type period = name->find ('.', 4); + std::string::size_type period = name->first.find ('.', 4); if (period != std::string::npos) - udas.push_back (name->substr (4, period - 4)); + udas.push_back (name->first.substr (4, period - 4)); } } diff --git a/src/commands/CmdUDAs.h b/src/commands/CmdUDAs.h index 118c74317..734932201 100644 --- a/src/commands/CmdUDAs.h +++ b/src/commands/CmdUDAs.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdUndo.cpp b/src/commands/CmdUndo.cpp index 994feb968..d8a1be34d 100644 --- a/src/commands/CmdUndo.cpp +++ b/src/commands/CmdUndo.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdUndo.h b/src/commands/CmdUndo.h index 47f999768..0a413164e 100644 --- a/src/commands/CmdUndo.h +++ b/src/commands/CmdUndo.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdUrgency.cpp b/src/commands/CmdUrgency.cpp index 5899f71e6..037b0583f 100644 --- a/src/commands/CmdUrgency.cpp +++ b/src/commands/CmdUrgency.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/commands/CmdUrgency.h b/src/commands/CmdUrgency.h index c81c47d9b..b3fe3aa95 100644 --- a/src/commands/CmdUrgency.h +++ b/src/commands/CmdUrgency.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/CmdVersion.cpp b/src/commands/CmdVersion.cpp index 2449ac583..4cb9e1b5a 100644 --- a/src/commands/CmdVersion.cpp +++ b/src/commands/CmdVersion.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,12 +25,14 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include #include -#include +#ifdef HAVE_COMMIT #include +#endif #include #include #include diff --git a/src/commands/CmdVersion.h b/src/commands/CmdVersion.h index e93c66d0c..bf75d8da9 100644 --- a/src/commands/CmdVersion.h +++ b/src/commands/CmdVersion.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index bd68267fb..8877f0e51 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -35,7 +36,6 @@ #include #include #include -#include #include #include @@ -61,6 +61,7 @@ #include #endif #include +#include #include #include #include @@ -133,6 +134,7 @@ void Command::factory (std::map & all) c = new CmdExec (); all[c->keyword ()] = c; #endif c = new CmdExport (); all[c->keyword ()] = c; + c = new CmdGet (); all[c->keyword ()] = c; c = new CmdGHistoryMonthly (); all[c->keyword ()] = c; c = new CmdGHistoryAnnual (); all[c->keyword ()] = c; c = new CmdHelp (); all[c->keyword ()] = c; @@ -170,16 +172,13 @@ void Command::factory (std::map & all) c = new CmdZshCompletionUuids (); all[c->keyword ()] = c; // Instantiate a command object for each custom report. - std::vector variables; - context.config.all (variables); - std::vector reports; - std::vector ::iterator i; - for (i = variables.begin (); i != variables.end (); ++i) + Config::const_iterator i; + for (i = context.config.begin (); i != context.config.end (); ++i) { - if (i->substr (0, 7) == "report.") + if (i->first.substr (0, 7) == "report.") { - std::string report = i->substr (7); + std::string report = i->first.substr (7); std::string::size_type columns = report.find (".columns"); if (columns != std::string::npos) reports.push_back (report.substr (0, columns)); @@ -465,200 +464,8 @@ void Command::modify_task ( const A3& arguments, std::string& description) { - // Coalesce arguments together into sets to be processed as a batch. - unsigned int pos = 0; - Arg arg; - while (next_mod_group (arguments, arg, pos)) - { - // Attributes are essentially name:value pairs, and correspond directly - // to stored attributes. - if (arg._category == Arg::cat_attr) - { - std::string name; - std::string value; - A3::extract_attr (arg._raw, name, value); - if (A3::is_attribute (name, name)) // Canonicalize - { - //std::cout << "# Command::modify_task name='" << name << "' value='" << value << "'\n"; - - // Get the column info. - Column* column = context.columns[name]; - - if (value == "") - { - task.remove (name); - } - else - { - // Dependencies are used as IDs. - if (name == "depends") - { - // Parse IDs - std::vector deps; - split (deps, value, ','); - - // Apply or remove dendencies in turn. - std::vector ::iterator i; - for (i = deps.begin (); i != deps.end (); i++) - { - bool removal = false; - std::string& dep = *i; - - if (dep[0] == '-') - { - removal = true; - dep = i->substr(1, std::string::npos); - } - - std::vector ids; - // Crude UUID check - if (dep.length () == 36) - { - int id = context.tdb2.pending.id (dep); - ids.push_back (id); - } - else - A3::extract_id (dep, ids); - - std::vector ::iterator id; - for (id = ids.begin (); id != ids.end(); id++) - if (removal) - task.removeDependency (*id); - else - task.addDependency (*id); - } - } - - // Priorities are converted to upper case. - else if (name == "priority") - { - task.set (name, upperCase (value)); - } - - // Dates are special, maybe. - else if (column->type () == "date") - { - // All values must be eval'd first. - A3 value_tokens; - value_tokens.capture (value); - value_tokens = value_tokens.postfix (value_tokens.tokenize (value_tokens)); - - E9 e (value_tokens); - std::string result = e.evalExpression (task); - context.debug (std::string ("Eval '") + value + "' --> '" + result + "'"); - - // If the date value is less than 5 years, it is a duration, not a - // date, therefore add 'now'. - long l = (long) strtod (result.c_str (), NULL); - if (labs (l) < 5 * 365 * 86400) - { - OldDuration dur (value); - Date now; - now += l; - task.set (name, now.toEpochString ()); - } - else - { - Date d (result, context.config.get ("dateformat")); - task.set (name, d.toEpochString ()); - } - } - - // OldDurations too. - else if (name == "recur" || - column->type () == "duration") - { - // All values must be eval'd first, in this case, just to catch errors. - A3 value_tokens; - value_tokens.capture (value); - value_tokens = value_tokens.postfix (value_tokens.tokenize (value_tokens)); - - E9 e (value_tokens); - std::string result = e.evalExpression (task); - context.debug (std::string ("Eval '") + value + "' --> '" + result + "'"); - - OldDuration d (value); - - // Deliberately storing the 'raw' value, which is necessary for - // durations like 'weekday'.. - task.set (name, name == "recur" ? value : result); - } - - // Need handling for numeric types, used by UDAs. - else if (column->type () == "numeric") - { - A3 value_tokens; - value_tokens.capture (value); - value_tokens = value_tokens.postfix (value_tokens.tokenize (value_tokens)); - - E9 e (value_tokens); - std::string result = e.evalExpression (task); - context.debug (std::string ("Eval '") + value + "' --> '" + result + "'"); - - Nibbler n (result); - double d; - if (n.getNumber (d) && - n.depleted ()) - task.set (name, result); - else - throw format (STRING_UDA_NUMERIC, result); - } - - // By default, just add/remove it. - else - { - if (column->validate (value)) - task.set (name, value); - else - throw format (STRING_INVALID_MOD, name, value); - } - - // Warn about deprecated/obsolete attribute usage. - legacyAttributeCheck (name); - } - } - else - throw format (STRING_CMD_ADD_BAD_ATTRIBUTE, name); - } - - // Tags need special handling because they are essentially a vector stored - // in a single string, therefore Task::{add,remove}Tag must be called as - // appropriate. - else if (arg._category == Arg::cat_tag) - { - char type; - std::string value; - A3::extract_tag (arg._raw, type, value); - - if (type == '+') - { - task.addTag (value); - feedback_special_tags (task, value); - } - else - task.removeTag (value); - } - - // Substitutions. - else if (arg._category == Arg::cat_subst) - { - std::string from; - std::string to; - bool global; - A3::extract_subst (arg._raw, from, to, global); - task.substitute (from, to, global); - } - - // Anything else is essentially downgraded to 'word' and considered part of - // the description. - else - { - if (description.length ()) - description += " "; - - description += arg._raw; - } - } + // Utilize Task::modify + task.modify (arguments, description); } //////////////////////////////////////////////////////////////////////////////// @@ -742,27 +549,3 @@ bool Command::permission ( } //////////////////////////////////////////////////////////////////////////////// -// Special processing for modifications. -bool Command::next_mod_group (const A3& input, Arg& arg, unsigned int& pos) -{ - if (pos < input.size ()) - { - arg = input[pos++]; - - if (arg._raw == "depends") - { - while (pos < input.size () && - (input[pos]._category == Arg::cat_op || - input[pos]._type == Arg::type_number)) - { - arg._raw += input[pos++]._raw; - } - } - - return true; - } - - return false; -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/commands/Command.h b/src/commands/Command.h index 1c822d2fe..d0c0e342b 100644 --- a/src/commands/Command.h +++ b/src/commands/Command.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -66,8 +66,6 @@ protected: void safety (); bool permission (const Task&, const std::string&, unsigned int); - bool next_mod_group (const A3&, Arg&, unsigned int&); - protected: std::string _keyword; std::string _usage; diff --git a/src/dependency.cpp b/src/dependency.cpp index 630107682..d8d13bcc8 100644 --- a/src/dependency.cpp +++ b/src/dependency.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/en-US.h b/src/en-US.h index 2125dbe63..5b9763ec6 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -116,6 +116,7 @@ #define STRING_A3_ID_AFTER_HYPHEN "Unrecognized ID after hyphen." #define STRING_A3_RANGE_INVERTED "Inverted range 'high-low' instead of 'low-high'" #define STRING_A3_UUID_AFTER_COMMA "Unrecognized UUID after comma." +#define STRING_A3_ZERO_ID "'{1}' is not a valid ID." // Color #define STRING_COLOR_UNRECOGNIZED "The color '{1}' is not recognized." @@ -176,6 +177,7 @@ #define STRING_COLUMN_LABEL_UDA "Name" #define STRING_COLUMN_LABEL_TYPE "Type" #define STRING_COLUMN_LABEL_LABEL "Label" +#define STRING_COLUMN_LABEL_DEFAULT "Default" #define STRING_COLUMN_LABEL_VALUES "Allowed Values" #define STRING_COLUMN_LABEL_UDACOUNT "Usage Count" #define STRING_COLUMN_LABEL_ORPHAN "Orphan UDA" @@ -306,6 +308,8 @@ #define STRING_CMD_SUMMARY_COMPLETE "Complete" #define STRING_CMD_SUMMARY_NONE "(none)" #define STRING_CMD_COUNT_USAGE "Counts matching tasks" +#define STRING_CMD_GET_USAGE "DOM Accessor" +#define STRING_CMD_GET_NO_DOM "No DOM reference specified." #define STRING_CMD_UDAS_NO "No UDAs defined." #define STRING_CMD_UDAS_SUMMARY "{1} UDA defined" @@ -394,15 +398,16 @@ #define STRING_CMD_IMPORT_SUMMARY "Imported {1} tasks." #define STRING_CMD_IMPORT_NOFILE "You must specify a file to import." #define STRING_CMD_IMPORT_FILE "Importing '{1}'" -#define STRING_CMD_IMPORT_NOT_JSON "Not a JSON object: {1}" -#define STRING_CMD_IMPORT_NO_DESC "Annotation is missing a description: {1}" -#define STRING_CMD_IMPORT_NO_ENTRY "Annotation is missing an entry date: {1}" +#define STRING_TASK_NO_DESC "Annotation is missing a description: {1}" +#define STRING_TASK_NO_ENTRY "Annotation is missing an entry date: {1}" #define STRING_CMD_SHELL_HELP1 "Enter any task command (such as 'list'), or hit 'Enter'." #define STRING_CMD_SHELL_HELP2 "There is no need to include the 'task' command itself." #define STRING_CMD_SHELL_HELP3 "Enter 'quit' (or 'bye', 'exit') to end the session." -#define STRING_CMD_SYNC_USAGE "Synchronizes data with the Task Server" -#define STRING_CMD_SYNC_NO_SERVER "Task Server is not configured." -#define STRING_CMD_SYNC_BAD_CRED "Task Server credentials malformed." +#define STRING_CMD_SYNC_USAGE "Synchronizes data with the Taskserver" +#define STRING_CMD_SYNC_NO_SERVER "Taskserver is not configured." +#define STRING_CMD_SYNC_BAD_CRED "Taskserver credentials malformed." +#define STRING_CMD_SYNC_BAD_CERT "Taskserver certificate missing." +#define STRING_CMD_SYNC_BAD_KEY "Taskserver key missing." #define STRING_CMD_SYNC_ADD " add {1} '{2}'" #define STRING_CMD_SYNC_MOD "modify {1} '{2}'" #define STRING_CMD_SYNC_PROGRESS "Syncing with {1}" @@ -411,10 +416,20 @@ #define STRING_CMD_SYNC_SUCCESS2 "Sync successful. {1} changes downloaded." #define STRING_CMD_SYNC_SUCCESS3 "Sync successful. {1} changes uploaded, {2} changes downloaded." #define STRING_CMD_SYNC_SUCCESS_NOP "Sync successful. No changes." -#define STRING_CMD_SYNC_FAIL_ACCOUNT "Sync failed. Either your credentials are incorrect, or your Task Server account is not enabled." -#define STRING_CMD_SYNC_FAIL_ERROR "Sync failed. The Task Server returned error: {1} {2}" -#define STRING_CMD_SYNC_FAIL_CONNECT "Sync failed. Could not connect to the Task Server." +#define STRING_CMD_SYNC_FAIL_ACCOUNT "Sync failed. Either your credentials are incorrect, or your Taskserver account is not enabled." +#define STRING_CMD_SYNC_FAIL_ERROR "Sync failed. The Taskserver returned error: {1} {2}" +#define STRING_CMD_SYNC_FAIL_CONNECT "Sync failed. Could not connect to the Taskserver." #define STRING_CMD_SYNC_BAD_SERVER "Sync failed. Malformed configuration setting '{1}'" +#define STRING_CMD_SYNC_NO_TLS "Taskwarrior was built without GnuTLS support. Sync is not available." +#define STRING_CMD_SYNC_INIT "Please confirm that you wish to upload all your pending tasks to the Taskserver" +#define STRING_CMD_SYNC_NO_INIT "Taskwarrior will not proceed with first-time sync initialization." +#define STRING_CMD_SYNC_RELOCATE0 "The server account has been relocated. Please update your configuration using:" +#define STRING_CMD_SYNC_RELOCATE1 "task config taskd.server {1}" +#define STRING_CMD_SYNC_BAD_CA "CA certificate not found." +#define STRING_CMD_SYNC_CONNECT "Could not connect to {1} {2}" +#define STRING_CMD_SYNC_HANDSHAKE "Handshake failed. {1}" +#define STRING_CMD_SYNC_NOMERGE "Task push/pull/merge is configured, deprecated, and does not work with 'sync'." +#define STRING_CMD_SYNC_TRUST_CA "You should either provide a CA certificate or override verification, but not both." #define STRING_CMD_DIAG_USAGE "Platform, build and environment details" #define STRING_CMD_DIAG_PLATFORM "Platform" #define STRING_CMD_DIAG_UNKNOWN "" @@ -431,8 +446,6 @@ #define STRING_CMD_DIAG_CONFIG "Configuration" #define STRING_CMD_DIAG_EXTERNAL "External Utilities" #define STRING_CMD_DIAG_TESTS "Tests" -#define STRING_CMD_DIAG_UUID_GOOD "1000 unique UUIDs generated." -#define STRING_CMD_DIAG_UUID_BAD "Failed - duplicate UUID at iteration {1}" #define STRING_CMD_DIAG_UUID_SCAN "Scanned {1} tasks for duplicate UUIDs:" #define STRING_CMD_DIAG_UUID_DUP "Found duplicate {1}" #define STRING_CMD_DIAG_UUID_NO_DUP "No duplicates found" @@ -552,7 +565,6 @@ // Date #define STRING_DATE_INVALID_FORMAT "'{1}' is not a valid date in the '{2}' format." #define STRING_DATE_BAD_WEEKSTART "The 'weekstart' configuration variable may only contain 'Sunday' or 'Monday'." -#define STRING_DATE_TOO_MUCH "The date is too far into the future." #define STRING_DATE_JANUARY_LONG "january" #define STRING_DATE_FEBRUARY_LONG "february" @@ -688,7 +700,6 @@ // TODO Move each of these to appropriate section. #define STRING_ERROR_PREFIX "Error: " #define STRING_UNKNOWN_ERROR "Unknown error." -#define STRING_NO_HOME "Could not read home directory from the passwd file." #define STRING_TRIVIAL_INPUT "You must specify a command or a task to modify." #define STRING_ASSUME_INFO "No command specified - assuming 'information'." #define STRING_INFINITE_LOOP "Terminated substitution because more than {1} changes were made - infinite loop protection." @@ -698,6 +709,7 @@ #define STRING_UDA_COLLISION "The UDA named '{1}' is the same as a core attribute, and is not permitted." #define STRING_INVALID_MOD "The '{1}' attribute does not allow a value of '{2}'." #define STRING_INVALID_SORT_COL "The '{1}' column is not a valid sort field." +#define STRING_TLS_INIT_FAIL "Error initializing TLS." // Feedback #define STRING_FEEDBACK_NO_TASKS "No tasks." @@ -750,9 +762,6 @@ #define STRING_JSON_MISSING_OPEN "Error: expected '{' or '[' at position {1}" #define STRING_JSON_EXTRA_CHARACTERS "Error: extra characters found at position {1}" -// Legacy -#define STRING_LEGACY_FEATURE "Note: the '{1}' feature is deprecated." - // Record #define STRING_RECORD_EMPTY "Empty record in input." #define STRING_RECORD_JUNK_AT_EOL "Unrecognized characters at end of line." @@ -764,7 +773,6 @@ #define STRING_CMD_SHOW_NONE "No matching configuration variables." #define STRING_CMD_SHOW_UNREC "Your .taskrc file contains these unrecognized variables:" #define STRING_CMD_SHOW_DIFFER "Some of your .taskrc variables differ from the default values." -#define STRING_CMD_SHOW_HOOKS "Your .taskrc file contains these missing or unreadable hook scripts:" #define STRING_CMD_SHOW_EMPTY "Configuration error: .taskrc contains no entries." #define STRING_CMD_SHOW_DIFFER_COLOR "These are highlighted in {1} above." #define STRING_CMD_SHOW_CONFIG_ERROR "Configuration error: {1} contains an unrecognized value '{2}'." @@ -776,6 +784,7 @@ // Task #define STRING_TASK_NO_FF1 "Taskwarrior no longer supports file format 1, originally used between 27 November 2006 and 31 December 2007." +#define STRING_TASK_NO_FF2 "Taskwarrior no longer supports file format 2, originally used between 1 January 2008 and 12 April 2009." #define STRING_TASK_PARSE_ANNO_BRACK "Missing annotation brackets." #define STRING_TASK_PARSE_ATT_BRACK "Missing attribute brackets." #define STRING_TASK_PARSE_TAG_BRACK "Missing tag brackets." @@ -826,8 +835,7 @@ #define STRING_TDB2_REVERTED "Modified task reverted." #define STRING_TDB2_REMOVED "Task removed." #define STRING_TDB2_UNDO_COMPLETE "Undo complete." -#define STRING_TDB2_MISSING_TASK "Task with UUID {1} not found in data." -#define STRING_TDB2_UNDO_IMPOSSIBLE "No undo possible." +#define STRING_TDB2_UNDO_SYNCED "Cannot undo change because the task was already synced. Modify the task instead." // text // A comma-separated list of commands is appended. diff --git a/src/es-ES.h b/src/es-ES.h index 286be2e8d..433288acd 100644 --- a/src/es-ES.h +++ b/src/es-ES.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -117,6 +117,7 @@ #define STRING_A3_ID_AFTER_HYPHEN "ID no reconocido tras guión." #define STRING_A3_RANGE_INVERTED "Rango invertido 'alto-bajo' en vez de 'bajo-alto'" #define STRING_A3_UUID_AFTER_COMMA "UUID no reconocido tras coma." +#define STRING_A3_ZERO_ID "'{1}' no es un ID válido." // Color #define STRING_COLOR_UNRECOGNIZED "El color '{1}' no se reconoce." @@ -178,6 +179,7 @@ #define STRING_COLUMN_LABEL_UDA "Nombre" #define STRING_COLUMN_LABEL_TYPE "Tipo" #define STRING_COLUMN_LABEL_LABEL "Etiqueta" +#define STRING_COLUMN_LABEL_DEFAULT "Defecto" #define STRING_COLUMN_LABEL_VALUES "Valores permitidos" #define STRING_COLUMN_LABEL_UDACOUNT "Recuento de uso" #define STRING_COLUMN_LABEL_ORPHAN "UDA huérfano" @@ -243,6 +245,7 @@ #define STRING_CMD_STATS_PROJECTS "Proyectos" #define STRING_CMD_STATS_DATA_SIZE "Tamaño de datos" #define STRING_CMD_STATS_UNDO_TXNS "Transacciones deshacer" +#define STRING_CMD_STATS_BACKLOG "Sincroniza transacciones atrasadas" #define STRING_CMD_STATS_TAGGED "Tareas marcadas" #define STRING_CMD_STATS_OLDEST "Tarea más antigua" #define STRING_CMD_STATS_NEWEST "Tarea más reciente" @@ -255,7 +258,7 @@ #define STRING_CMD_STATS_DESC_LEN "Longitud media de desc" #define STRING_CMD_STATS_CHARS "{1} caracteres" -#define STRING_CMD_STATS_LAST_SYNCH "Última sincronización con el servidor" +#define STRING_CMD_STATS_LAST_SYNC "Ültima sincronización del servidor" #define STRING_CMD_STATS_BLOCKED "Tareas bloqueadas" #define STRING_CMD_STATS_BLOCKING "Tareas bloqueantes" #define STRING_CMD_REPORTS_USAGE "Lista todos los informes soportados" @@ -314,6 +317,8 @@ #define STRING_CMD_SUMMARY_COMPLETE "Completas" #define STRING_CMD_SUMMARY_NONE "(ninguna)" #define STRING_CMD_COUNT_USAGE "Cuenta tareas que coinciden" +#define STRING_CMD_GET_USAGE "Método de acceso al DOM" +#define STRING_CMD_GET_NO_DOM "Referencia a DOM no especificada." #define STRING_CMD_UDAS_NO "Ningún UDA definido." #define STRING_CMD_UDAS_SUMMARY "{1} UDA definido" @@ -403,15 +408,39 @@ #define STRING_CMD_IMPORT_SUMMARY "Importadas {1} tareas." #define STRING_CMD_IMPORT_NOFILE "Debe especificar un archivo a importar." #define STRING_CMD_IMPORT_FILE "Importando '{1}'" -#define STRING_CMD_IMPORT_NOT_JSON "No es un objeto JSON: {1}" -#define STRING_CMD_IMPORT_NO_DESC "La anotación carece de descripción: {1}" -#define STRING_CMD_IMPORT_NO_ENTRY "La anotación carece de fecha de entrada: {1}" -#define STRING_CMD_SHELL_USAGE "Lanza un entorno de comandos interactivo" +#define STRING_TASK_NO_DESC "La anotación carece de descripción: {1}" +#define STRING_TASK_NO_ENTRY "La anotación carece de fecha de entrada: {1}" #define STRING_CMD_SHELL_HELP1 "Escriba un comando de task (como 'list'), o pulse 'Enter'." #define STRING_CMD_SHELL_HELP2 "No hace falta incluir el propio comando 'task'." #define STRING_CMD_SHELL_HELP3 "Escriba 'quit' (o 'bye', 'exit') para terminar la sesión." -#define STRING_CMD_SYNCH_USAGE "Sincroniza datos con el Servidor Task" -#define STRING_CMD_SYNCH_NO_SERVER "El Servidor Task no está configurado." + +#define STRING_CMD_SYNC_USAGE "Sincroniza datos con el Servidor Task" +#define STRING_CMD_SYNC_NO_SERVER "El Servidor Task no está configurado." +#define STRING_CMD_SYNC_BAD_CRED "Credenciales del Servidor Task incorrectas." +#define STRING_CMD_SYNC_BAD_CERT "Certificado del Servidor Task no encontrado." +#define STRING_CMD_SYNC_BAD_KEY "Clave del Servidor Task no encontrada." +#define STRING_CMD_SYNC_ADD " añade {1} '{2}'" +#define STRING_CMD_SYNC_MOD "modifica {1} '{2}'" +#define STRING_CMD_SYNC_PROGRESS "Sincronizando con {1}" +#define STRING_CMD_SYNC_SUCCESS0 "Sincronización correcta." +#define STRING_CMD_SYNC_SUCCESS1 "Sincronización correcta. {1} cambios enviados." +#define STRING_CMD_SYNC_SUCCESS2 "Sincronización correcta. {1} cambios recibidos." +#define STRING_CMD_SYNC_SUCCESS3 "Sincronización correcta. {1} cambios enviados, {2} cambios recibidos." +#define STRING_CMD_SYNC_SUCCESS_NOP "Sincronización correcta. No hay cambios" +#define STRING_CMD_SYNC_FAIL_ACCOUNT "Sincronización fallida. O bien sus credenciales son incorrectas, o su cuenta de Servidor Task no está habilitada." +#define STRING_CMD_SYNC_FAIL_ERROR "Sincronización fallida. El Servidor Task devolvió error: {1} {2}" +#define STRING_CMD_SYNC_FAIL_CONNECT "Sincronización fallida. No se pudo conectar con el Servidor Task." +#define STRING_CMD_SYNC_BAD_SERVER "Sincronización fallida. Ajuste de configuración '{1}' incorrecto" +#define STRING_CMD_SYNC_NO_TLS "Taskwarrior fue construido sin soporte GnuTLS. Sincronización no disponible." +#define STRING_CMD_SYNC_INIT "Por favor, confirme que desea subir todas sus tareas pendientes al Servidor Task" +#define STRING_CMD_SYNC_NO_INIT "Taskwarrior no procederá a la inicialización de la sincronización por primera vez." +#define STRING_CMD_SYNC_RELOCATE0 "La cuenta del servidor ha sido reubicada. Por favor, actualice su configuración utilizando:" +#define STRING_CMD_SYNC_RELOCATE1 "task config taskd.server {1}" +#define STRING_CMD_SYNC_BAD_CA "Certificado CA no encontrado." +#define STRING_CMD_SYNC_CONNECT "No se pudo conectar a {1} {2}" +#define STRING_CMD_SYNC_HANDSHAKE "Handshake fallido. {1}" +#define STRING_CMD_SYNC_NOMERGE "Task push/pull/merge está configurado, en desuso, y no trabaja con 'sync'." +#define STRING_CMD_SYNC_TRUST_CA "Debe proveer un certificado CA o la verificación de sobrescritura, pero no ambos." #define STRING_CMD_DIAG_USAGE "Detalles de plataforma, construcción y entorno" #define STRING_CMD_DIAG_PLATFORM "Plataforma" #define STRING_CMD_DIAG_UNKNOWN "" @@ -420,7 +449,7 @@ #define STRING_CMD_DIAG_CAPS "Capacidades" #define STRING_CMD_DIAG_FEATURES "Características Constructivas" #define STRING_CMD_DIAG_BUILT "Construido" -#define STRING_CMD_DIAG_COMMIT "Commit" +#define STRING_CMD_DIAG_COMMIT "Commit" // sic #define STRING_CMD_DIAG_FOUND "(encontrado)" #define STRING_CMD_DIAG_MISSING "(no encontrado)" #define STRING_CMD_DIAG_ENABLED "Habilitado" @@ -428,8 +457,6 @@ #define STRING_CMD_DIAG_CONFIG "Configuración" #define STRING_CMD_DIAG_EXTERNAL "Utilidades externas" #define STRING_CMD_DIAG_TESTS "Comprobaciones" -#define STRING_CMD_DIAG_UUID_GOOD "1000 UUIDs únicos generados." -#define STRING_CMD_DIAG_UUID_BAD "Fallo - UUID duplicado en la iteración {1}" #define STRING_CMD_DIAG_UUID_SCAN "Exploradas {1} tareas buscando UUIDs duplicados:" #define STRING_CMD_DIAG_UUID_DUP "Encontrado duplicado {1}" #define STRING_CMD_DIAG_UUID_NO_DUP "No se encontraron duplicados" @@ -547,13 +574,11 @@ #define STRING_CONTEXT_SHADOW_C "La variable de configuración 'shadow.file' está ajustada a " "sobreescribrir sus tareas completadas. Por favor, cambie esto." #define STRING_CONTEXT_SHADOW_U "La variable de configuración 'shadow.file' está ajustada a " "sobreescribrir su registro de deshacer. Por favor, cambie esto." #define STRING_CONTEXT_SHADOW_B "La variable de configuración 'shadow.file' está ajustada a " "sobreescribrir su archivo backlog. Por favor, cambie esto." -#define STRING_CONTEXT_SHADOW_S "La variable de configuración 'shadow.file' está ajustada a " "sobreescribrir su archivo synch.key. Por favor, cambie esto." #define STRING_CONTEXT_SHADOW_UPDATE "[Archivo shadow '{1}' actualizado.]" // Date #define STRING_DATE_INVALID_FORMAT "'{1}' no es una fecha válida según el formato '{2}'." #define STRING_DATE_BAD_WEEKSTART "La variable de configuración 'weekstart' solamente puede contener 'Sunday' (domingo) o 'Monday' (lunes)." -#define STRING_DATE_TOO_MUCH "La fecha está demasiado alejada en el futuro." #define STRING_DATE_JANUARY_LONG "enero" #define STRING_DATE_FEBRUARY_LONG "febrero" @@ -689,7 +714,6 @@ // TODO Move each of these to appropriate section. #define STRING_ERROR_PREFIX "Error: " #define STRING_UNKNOWN_ERROR "Error desconocido." -#define STRING_NO_HOME "No se pudo leer el directorio personal en el archivo passwd." #define STRING_TRIVIAL_INPUT "Debe especificar un comando o una tarea a modificar." #define STRING_ASSUME_INFO "No especificó un comando - asumido 'information'." #define STRING_INFINITE_LOOP "Sustitución terminada debido a que se hicieron más de {1} cambios - protección contra ciclo eterno." @@ -699,6 +723,7 @@ #define STRING_UDA_COLLISION "El UDA denominado '{1}' es el mismo que un atributo del núcleo, y no está permitido." #define STRING_INVALID_MOD "El atributo '{1}' no admite un valor '{2}'." #define STRING_INVALID_SORT_COL "La columna '{1}' no es un campo de ordenación válido." +#define STRING_TLS_INIT_FAIL "Error inicializando TLS." // Feedback #define STRING_FEEDBACK_NO_TASKS "Ninguna tarea." @@ -751,9 +776,6 @@ #define STRING_JSON_MISSING_OPEN "Error: se esperaba '{' or '[' en posición {1}" #define STRING_JSON_EXTRA_CHARACTERS "Error: encontrados caracteres extra en posición {1}" -// Legacy -#define STRING_LEGACY_FEATURE "Note: la función '{1}' está en desuso." - // Record #define STRING_RECORD_EMPTY "Registro vacío en la entrada." #define STRING_RECORD_JUNK_AT_EOL "Caracteres no reconocidos al final de línea." @@ -765,7 +787,6 @@ #define STRING_CMD_SHOW_NONE "No hay variables de configuración que coincidan." #define STRING_CMD_SHOW_UNREC "Su archivo .taskrc contiene estas variables no reconocidas:" #define STRING_CMD_SHOW_DIFFER "Algunas de sus variables .taskrc difieren de los valores por defecto." -#define STRING_CMD_SHOW_HOOKS "Su archivo .taskrc contiene estos hook scripts que faltan o no se pueden leer:" #define STRING_CMD_SHOW_EMPTY "Error de configuración: .taskrc no contiene ninguna entrada." #define STRING_CMD_SHOW_DIFFER_COLOR "Las cambiadas aparecen resaltadas en {1} más arriba." #define STRING_CMD_SHOW_CONFIG_ERROR "Error de configuración: {1} contiene un valor '{2}' no reconocido." @@ -777,6 +798,7 @@ // Task #define STRING_TASK_NO_FF1 "Taskwarrior ya no admite el formato de archivo 1, usado originalmente entre el 27 de noviembre del 2006 y el 31 de diciembre del 2007." +#define STRING_TASK_NO_FF2 "Taskwarrior ya no admite el formato de archivo 2, usado originalmente entre el 1 de enero del 2008 y el 12 de abril del 2009." #define STRING_TASK_PARSE_ANNO_BRACK "Faltan corchetes de anotación." #define STRING_TASK_PARSE_ATT_BRACK "Faltan corchetes de atributo." #define STRING_TASK_PARSE_TAG_BRACK "Faltan corchetes de marca." @@ -828,8 +850,7 @@ #define STRING_TDB2_REVERTED "Tarea modificada revertida." #define STRING_TDB2_REMOVED "Tarea eliminada." #define STRING_TDB2_UNDO_COMPLETE "Deshacer completado." -#define STRING_TDB2_MISSING_TASK "Tarea con UUID {1} no encontrada en los datos." -#define STRING_TDB2_UNDO_IMPOSSIBLE "No es posible deshacer." +#define STRING_TDB2_UNDO_SYNCED "No se puede deshacer el cambio porque la tarea ya ha sido sincronizada. Como alternativa, modifique la tarea." // text // Se añade al final una lista de comandos separados por comas. @@ -998,5 +1019,14 @@ #define STRING_UTIL_KIBIBYTES "KiB" #define STRING_UTIL_BYTES "B" +// shell +#define STRING_SHELL_USAGE \ + "Uso: tasksh [] Ejecuta los comandos task contenidos en , si se indica;\n" \ + " si no, lanza un entorno interactivo de comandos task.\n" \ + " tasksh --version Muestra la versión de task.\n" \ + " tasksh --help Muestra esta ayuda.\n" + +#define STRING_SHELL_NO_FILE "El fichero de entrada no existe.\n" + #endif diff --git a/src/feedback.cpp b/src/feedback.cpp index ea238c2ed..8e7e0522a 100644 --- a/src/feedback.cpp +++ b/src/feedback.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include extern Context context; @@ -427,7 +427,7 @@ void feedback_backlog () std::vector ::iterator line; for (line = lines.begin (); line != lines.end (); ++line) { - if ((*line)[0] == '[') + if ((*line)[0] == '{') { context.footnote ("There are local changes. Sync required."); break; diff --git a/src/fr-FR.h b/src/fr-FR.h index a72938d88..bb9db10bc 100644 --- a/src/fr-FR.h +++ b/src/fr-FR.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -116,69 +116,71 @@ #define STRING_A3_ID_AFTER_HYPHEN "Unrecognized ID after hyphen." #define STRING_A3_RANGE_INVERTED "Inverted range 'high-low' instead of 'low-high'" #define STRING_A3_UUID_AFTER_COMMA "Unrecognized UUID after comma." +#define STRING_A3_ZERO_ID "'{1}' is not a valid ID." // Color #define STRING_COLOR_UNRECOGNIZED "The color '{1}' is not recognized." // columns/Col* -#define STRING_COLUMN_BAD_NAME "Unrecognized column name '{1}'." -#define STRING_COLUMN_BAD_FORMAT "Unrecognized column format '{1}.{2}'" -#define STRING_COLUMN_LABEL_TASKS "Tasks" -#define STRING_COLUMN_LABEL_DEP "Depends" -#define STRING_COLUMN_LABEL_DEP_S "Dep" +#define STRING_COLUMN_BAD_NAME "Nom de colonne non reconnu '{1}'." +#define STRING_COLUMN_BAD_FORMAT "Format de colonne non reconnu '{1}.{2}'" +#define STRING_COLUMN_LABEL_TASKS "Tâches" +#define STRING_COLUMN_LABEL_DEP "Dépends de" +#define STRING_COLUMN_LABEL_DEP_S "Dép" #define STRING_COLUMN_LABEL_DESC "Description" -#define STRING_COLUMN_LABEL_DUE "Due" -#define STRING_COLUMN_LABEL_END "End" -#define STRING_COLUMN_LABEL_ENTERED "Entered" -#define STRING_COLUMN_LABEL_COUNT "Count" -#define STRING_COLUMN_LABEL_COMPLETE "Completed" -#define STRING_COLUMN_LABEL_MOD "Modified" -#define STRING_COLUMN_LABEL_ADDED "Added" +#define STRING_COLUMN_LABEL_DUE "Échéance" +#define STRING_COLUMN_LABEL_END "Fin" +#define STRING_COLUMN_LABEL_ENTERED "Entrée" +#define STRING_COLUMN_LABEL_COUNT "Temps restant" +#define STRING_COLUMN_LABEL_COMPLETE "Complétée" +#define STRING_COLUMN_LABEL_MOD "Modifiée" +#define STRING_COLUMN_LABEL_ADDED "Ajoutée" #define STRING_COLUMN_LABEL_AGE "Age" #define STRING_COLUMN_LABEL_ID "ID" #define STRING_COLUMN_LABEL_PRI "Pri" -#define STRING_COLUMN_LABEL_PRIORITY "Priority" -#define STRING_COLUMN_LABEL_PROJECT "Project" +#define STRING_COLUMN_LABEL_PRIORITY "Priorité" +#define STRING_COLUMN_LABEL_PROJECT "Projet" #define STRING_COLUMN_LABEL_UNTIL "Until" -#define STRING_COLUMN_LABEL_WAIT "Wait" -#define STRING_COLUMN_LABEL_WAITING "Waiting until" -#define STRING_COLUMN_LABEL_RECUR "Recur" -#define STRING_COLUMN_LABEL_RECUR_L "Recurrence" -#define STRING_COLUMN_LABEL_START "Start" -#define STRING_COLUMN_LABEL_STARTED "Started" +#define STRING_COLUMN_LABEL_WAIT "Attente" +#define STRING_COLUMN_LABEL_WAITING "En attente jusqu’au" +#define STRING_COLUMN_LABEL_RECUR "Récur" +#define STRING_COLUMN_LABEL_RECUR_L "Récurrence" +#define STRING_COLUMN_LABEL_START "Début" +#define STRING_COLUMN_LABEL_STARTED "Débutée" #define STRING_COLUMN_LABEL_ACTIVE "A" -#define STRING_COLUMN_LABEL_STATUS "Status" +#define STRING_COLUMN_LABEL_STATUS "Statut" #define STRING_COLUMN_LABEL_STAT "St" -#define STRING_COLUMN_LABEL_STAT_PE "Pending" -#define STRING_COLUMN_LABEL_STAT_CO "Completed" -#define STRING_COLUMN_LABEL_STAT_DE "Deleted" -#define STRING_COLUMN_LABEL_STAT_WA "Waiting" -#define STRING_COLUMN_LABEL_STAT_RE "Recurring" +#define STRING_COLUMN_LABEL_STAT_PE "Prévue" +#define STRING_COLUMN_LABEL_STAT_CO "Complétée" +#define STRING_COLUMN_LABEL_STAT_DE "Supprimée" +#define STRING_COLUMN_LABEL_STAT_WA "En attente" +#define STRING_COLUMN_LABEL_STAT_RE "Récurrente" #define STRING_COLUMN_LABEL_STAT_P "P" #define STRING_COLUMN_LABEL_STAT_C "C" -#define STRING_COLUMN_LABEL_STAT_D "D" -#define STRING_COLUMN_LABEL_STAT_W "W" +#define STRING_COLUMN_LABEL_STAT_D "S" +#define STRING_COLUMN_LABEL_STAT_W "A" #define STRING_COLUMN_LABEL_STAT_R "R" -#define STRING_COLUMN_LABEL_TAGS "Tags" -#define STRING_COLUMN_LABEL_TAG "Tag" +#define STRING_COLUMN_LABEL_TAGS "Étiquettes" +#define STRING_COLUMN_LABEL_TAG "Étiquette" #define STRING_COLUMN_LABEL_UUID "UUID" -#define STRING_COLUMN_LABEL_URGENCY "Urgency" -#define STRING_COLUMN_LABEL_NAME "Name" -#define STRING_COLUMN_LABEL_VALUE "Value" -#define STRING_COLUMN_LABEL_MASK "Mask" -#define STRING_COLUMN_LABEL_MASK_IDX "Mask Index" -#define STRING_COLUMN_LABEL_PARENT "Parent task" +#define STRING_COLUMN_LABEL_URGENCY "Urgence" +#define STRING_COLUMN_LABEL_NAME "Nom" +#define STRING_COLUMN_LABEL_VALUE "Valeur" +#define STRING_COLUMN_LABEL_MASK "Masque" +#define STRING_COLUMN_LABEL_MASK_IDX "Index de masque" +#define STRING_COLUMN_LABEL_PARENT "Tâche mère" #define STRING_COLUMN_LABEL_DATE "Date" -#define STRING_COLUMN_LABEL_COLUMN "Columns" -#define STRING_COLUMN_LABEL_STYLES "Supported Formats" -#define STRING_COLUMN_LABEL_EXAMPLES "Example" -#define STRING_COLUMN_LABEL_SCHED "Scheduled" -#define STRING_COLUMN_LABEL_UDA "Name" +#define STRING_COLUMN_LABEL_COLUMN "Colonnes" +#define STRING_COLUMN_LABEL_STYLES "Formats supportés" +#define STRING_COLUMN_LABEL_EXAMPLES "Exemple" +#define STRING_COLUMN_LABEL_SCHED "Planifiée" +#define STRING_COLUMN_LABEL_UDA "Nom" #define STRING_COLUMN_LABEL_TYPE "Type" -#define STRING_COLUMN_LABEL_LABEL "Label" -#define STRING_COLUMN_LABEL_VALUES "Allowed Values" -#define STRING_COLUMN_LABEL_UDACOUNT "Usage Count" -#define STRING_COLUMN_LABEL_ORPHAN "Orphan UDA" +#define STRING_COLUMN_LABEL_LABEL "Étiquette" +#define STRING_COLUMN_LABEL_DEFAULT "Défaut" +#define STRING_COLUMN_LABEL_VALUES "Valeurs autorisées" +#define STRING_COLUMN_LABEL_UDACOUNT "Compte d’utilisation" +#define STRING_COLUMN_LABEL_ORPHAN "ADU orphelins" // Column Examples #define STRING_COLUMN_EXAMPLES_TAGS "home @chore next" @@ -306,6 +308,8 @@ #define STRING_CMD_SUMMARY_COMPLETE "Complete" #define STRING_CMD_SUMMARY_NONE "(none)" #define STRING_CMD_COUNT_USAGE "Counts matching tasks" +#define STRING_CMD_GET_USAGE "DOM Accessor" +#define STRING_CMD_GET_NO_DOM "No DOM reference specified." #define STRING_CMD_UDAS_NO "No UDAs defined." #define STRING_CMD_UDAS_SUMMARY "{1} UDA defined" @@ -394,15 +398,16 @@ #define STRING_CMD_IMPORT_SUMMARY "Imported {1} tasks." #define STRING_CMD_IMPORT_NOFILE "You must specify a file to import." #define STRING_CMD_IMPORT_FILE "Importing '{1}'" -#define STRING_CMD_IMPORT_NOT_JSON "Not a JSON object: {1}" -#define STRING_CMD_IMPORT_NO_DESC "Annotation is missing a description: {1}" -#define STRING_CMD_IMPORT_NO_ENTRY "Annotation is missing an entry date: {1}" +#define STRING_TASK_NO_DESC "Annotation is missing a description: {1}" +#define STRING_TASK_NO_ENTRY "Annotation is missing an entry date: {1}" #define STRING_CMD_SHELL_HELP1 "Enter any task command (such as 'list'), or hit 'Enter'." #define STRING_CMD_SHELL_HELP2 "There is no need to include the 'task' command itself." #define STRING_CMD_SHELL_HELP3 "Enter 'quit' (or 'bye', 'exit') to end the session." -#define STRING_CMD_SYNC_USAGE "Synchronizes data with the Task Server" -#define STRING_CMD_SYNC_NO_SERVER "Task Server is not configured." -#define STRING_CMD_SYNC_BAD_CRED "Task Server credentials malformed." +#define STRING_CMD_SYNC_USAGE "Synchronizes data with the Taskserver" +#define STRING_CMD_SYNC_NO_SERVER "Taskserver is not configured." +#define STRING_CMD_SYNC_BAD_CRED "Taskserver credentials malformed." +#define STRING_CMD_SYNC_BAD_CERT "Taskserver certificate missing." +#define STRING_CMD_SYNC_BAD_KEY "Taskserver key missing." #define STRING_CMD_SYNC_ADD " add {1} '{2}'" #define STRING_CMD_SYNC_MOD "modify {1} '{2}'" #define STRING_CMD_SYNC_PROGRESS "Syncing with {1}" @@ -411,10 +416,20 @@ #define STRING_CMD_SYNC_SUCCESS2 "Sync successful. {1} changes downloaded." #define STRING_CMD_SYNC_SUCCESS3 "Sync successful. {1} changes uploaded, {2} changes downloaded." #define STRING_CMD_SYNC_SUCCESS_NOP "Sync successful. No changes." -#define STRING_CMD_SYNC_FAIL_ACCOUNT "Sync failed. Either your credentials are incorrect, or your Task Server account is not enabled." -#define STRING_CMD_SYNC_FAIL_ERROR "Sync failed. The Task Server returned error: {1} {2}" -#define STRING_CMD_SYNC_FAIL_CONNECT "Sync failed. Could not connect to the Task Server." +#define STRING_CMD_SYNC_FAIL_ACCOUNT "Sync failed. Either your credentials are incorrect, or your Taskserver account is not enabled." +#define STRING_CMD_SYNC_FAIL_ERROR "Sync failed. The Taskserver returned error: {1} {2}" +#define STRING_CMD_SYNC_FAIL_CONNECT "Sync failed. Could not connect to the Taskserver." #define STRING_CMD_SYNC_BAD_SERVER "Sync failed. Malformed configuration setting '{1}'" +#define STRING_CMD_SYNC_NO_TLS "Taskwarrior was built without GnuTLS support. Sync is not available." +#define STRING_CMD_SYNC_INIT "Please confirm that you wish to upload all your pending tasks to the Taskserver" +#define STRING_CMD_SYNC_NO_INIT "Taskwarrior will not proceed with first-time sync initialization." +#define STRING_CMD_SYNC_RELOCATE0 "The server account has been relocated. Please update your configuration using:" +#define STRING_CMD_SYNC_RELOCATE1 "task config taskd.server {1}" +#define STRING_CMD_SYNC_BAD_CA "CA certificate not found." +#define STRING_CMD_SYNC_CONNECT "Could not connect to {1} {2}" +#define STRING_CMD_SYNC_HANDSHAKE "Handshake failed. {1}" +#define STRING_CMD_SYNC_NOMERGE "Task push/pull/merge is configured, deprecated, and does not work with 'sync'." +#define STRING_CMD_SYNC_TRUST_CA "You should either provide a CA certificate or override verification, but not both." #define STRING_CMD_DIAG_USAGE "Platform, build and environment details" #define STRING_CMD_DIAG_PLATFORM "Platform" #define STRING_CMD_DIAG_UNKNOWN "" @@ -431,8 +446,6 @@ #define STRING_CMD_DIAG_CONFIG "Configuration" #define STRING_CMD_DIAG_EXTERNAL "External Utilities" #define STRING_CMD_DIAG_TESTS "Tests" -#define STRING_CMD_DIAG_UUID_GOOD "1000 unique UUIDs generated." -#define STRING_CMD_DIAG_UUID_BAD "Failed - duplicate UUID at iteration {1}" #define STRING_CMD_DIAG_UUID_SCAN "Scanned {1} tasks for duplicate UUIDs:" #define STRING_CMD_DIAG_UUID_DUP "Found duplicate {1}" #define STRING_CMD_DIAG_UUID_NO_DUP "No duplicates found" @@ -550,51 +563,50 @@ #define STRING_CONTEXT_SHADOW_UPDATE "[Shadow file '{1}' updated.]" // Date -#define STRING_DATE_INVALID_FORMAT "'{1}' is not a valid date in the '{2}' format." -#define STRING_DATE_BAD_WEEKSTART "The 'weekstart' configuration variable may only contain 'Sunday' or 'Monday'." -#define STRING_DATE_TOO_MUCH "The date is too far into the future." +#define STRING_DATE_INVALID_FORMAT "'{1}' n'est pas une date au format '{2}'." +#define STRING_DATE_BAD_WEEKSTART "La variable de configuration 'weekstart' ne peut contenir que 'dimanche' ou 'lundi'." -#define STRING_DATE_JANUARY_LONG "january" -#define STRING_DATE_FEBRUARY_LONG "february" -#define STRING_DATE_MARCH_LONG "march" -#define STRING_DATE_APRIL_LONG "april" -#define STRING_DATE_MAY_LONG "may" -#define STRING_DATE_JUNE_LONG "june" -#define STRING_DATE_JULY_LONG "july" -#define STRING_DATE_AUGUST_LONG "august" -#define STRING_DATE_SEPTEMBER_LONG "september" -#define STRING_DATE_OCTOBER_LONG "october" -#define STRING_DATE_NOVEMBER_LONG "november" -#define STRING_DATE_DECEMBER_LONG "december" +#define STRING_DATE_JANUARY_LONG "janvier" +#define STRING_DATE_FEBRUARY_LONG "février" +#define STRING_DATE_MARCH_LONG "mars" +#define STRING_DATE_APRIL_LONG "avril" +#define STRING_DATE_MAY_LONG "mai" +#define STRING_DATE_JUNE_LONG "juin" +#define STRING_DATE_JULY_LONG "juillet" +#define STRING_DATE_AUGUST_LONG "août" +#define STRING_DATE_SEPTEMBER_LONG "septembre" +#define STRING_DATE_OCTOBER_LONG "octobre" +#define STRING_DATE_NOVEMBER_LONG "novembre" +#define STRING_DATE_DECEMBER_LONG "décembre" #define STRING_DATE_JANUARY_SHORT "jan" -#define STRING_DATE_FEBRUARY_SHORT "feb" +#define STRING_DATE_FEBRUARY_SHORT "fév" #define STRING_DATE_MARCH_SHORT "mar" -#define STRING_DATE_APRIL_SHORT "apr" -#define STRING_DATE_MAY_SHORT "may" +#define STRING_DATE_APRIL_SHORT "avr" +#define STRING_DATE_MAY_SHORT "mai" #define STRING_DATE_JUNE_SHORT "jun" #define STRING_DATE_JULY_SHORT "jul" -#define STRING_DATE_AUGUST_SHORT "aug" +#define STRING_DATE_AUGUST_SHORT "aoû" #define STRING_DATE_SEPTEMBER_SHORT "sep" #define STRING_DATE_OCTOBER_SHORT "oct" #define STRING_DATE_NOVEMBER_SHORT "nov" -#define STRING_DATE_DECEMBER_SHORT "dec" +#define STRING_DATE_DECEMBER_SHORT "déc" -#define STRING_DATE_SUNDAY_LONG "sunday" -#define STRING_DATE_MONDAY_LONG "monday" -#define STRING_DATE_TUESDAY_LONG "tuesday" -#define STRING_DATE_WEDNESDAY_LONG "wednesday" -#define STRING_DATE_THURSDAY_LONG "thursday" -#define STRING_DATE_FRIDAY_LONG "friday" -#define STRING_DATE_SATURDAY_LONG "saturday" +#define STRING_DATE_SUNDAY_LONG "dimanche" +#define STRING_DATE_MONDAY_LONG "lundi" +#define STRING_DATE_TUESDAY_LONG "mardi" +#define STRING_DATE_WEDNESDAY_LONG "mercredi" +#define STRING_DATE_THURSDAY_LONG "jeudi" +#define STRING_DATE_FRIDAY_LONG "vendredi" +#define STRING_DATE_SATURDAY_LONG "samedi" -#define STRING_DATE_SUNDAY_SHORT "sun" -#define STRING_DATE_MONDAY_SHORT "mon" -#define STRING_DATE_TUESDAY_SHORT "tue" -#define STRING_DATE_WEDNESDAY_SHORT "wed" -#define STRING_DATE_THURSDAY_SHORT "thu" -#define STRING_DATE_FRIDAY_SHORT "fri" -#define STRING_DATE_SATURDAY_SHORT "sat" +#define STRING_DATE_SUNDAY_SHORT "dim" +#define STRING_DATE_MONDAY_SHORT "lun" +#define STRING_DATE_TUESDAY_SHORT "mar" +#define STRING_DATE_WEDNESDAY_SHORT "mer" +#define STRING_DATE_THURSDAY_SHORT "jeu" +#define STRING_DATE_FRIDAY_SHORT "ven" +#define STRING_DATE_SATURDAY_SHORT "sam" // dependency #define STRING_DEPEND_BLOCKED "Task {1} is blocked by:" @@ -688,7 +700,6 @@ // TODO Move each of these to appropriate section. #define STRING_ERROR_PREFIX "Error: " #define STRING_UNKNOWN_ERROR "Unknown error." -#define STRING_NO_HOME "Could not read home directory from the passwd file." #define STRING_TRIVIAL_INPUT "You must specify a command or a task to modify." #define STRING_ASSUME_INFO "No command specified - assuming 'information'." #define STRING_INFINITE_LOOP "Terminated substitution because more than {1} changes were made - infinite loop protection." @@ -698,6 +709,7 @@ #define STRING_UDA_COLLISION "The UDA named '{1}' is the same as a core attribute, and is not permitted." #define STRING_INVALID_MOD "The '{1}' attribute does not allow a value of '{2}'." #define STRING_INVALID_SORT_COL "The '{1}' column is not a valid sort field." +#define STRING_TLS_INIT_FAIL "Error initializing TLS." // Feedback #define STRING_FEEDBACK_NO_TASKS "No tasks." @@ -750,9 +762,6 @@ #define STRING_JSON_MISSING_OPEN "Error: expected '{' or '[' at position {1}" #define STRING_JSON_EXTRA_CHARACTERS "Error: extra characters found at position {1}" -// Legacy -#define STRING_LEGACY_FEATURE "Note: the '{1}' feature is deprecated." - // Record #define STRING_RECORD_EMPTY "Empty record in input." #define STRING_RECORD_JUNK_AT_EOL "Unrecognized characters at end of line." @@ -764,7 +773,6 @@ #define STRING_CMD_SHOW_NONE "No matching configuration variables." #define STRING_CMD_SHOW_UNREC "Your .taskrc file contains these unrecognized variables:" #define STRING_CMD_SHOW_DIFFER "Some of your .taskrc variables differ from the default values." -#define STRING_CMD_SHOW_HOOKS "Your .taskrc file contains these missing or unreadable hook scripts:" #define STRING_CMD_SHOW_EMPTY "Configuration error: .taskrc contains no entries." #define STRING_CMD_SHOW_DIFFER_COLOR "These are highlighted in {1} above." #define STRING_CMD_SHOW_CONFIG_ERROR "Configuration error: {1} contains an unrecognized value '{2}'." @@ -776,6 +784,7 @@ // Task #define STRING_TASK_NO_FF1 "Taskwarrior no longer supports file format 1, originally used between 27 November 2006 and 31 December 2007." +#define STRING_TASK_NO_FF2 "Taskwarrior no longer supports file format 2, originally used between 1 January 2008 and 12 April 2009." #define STRING_TASK_PARSE_ANNO_BRACK "Missing annotation brackets." #define STRING_TASK_PARSE_ATT_BRACK "Missing attribute brackets." #define STRING_TASK_PARSE_TAG_BRACK "Missing tag brackets." @@ -826,8 +835,7 @@ #define STRING_TDB2_REVERTED "Modified task reverted." #define STRING_TDB2_REMOVED "Task removed." #define STRING_TDB2_UNDO_COMPLETE "Undo complete." -#define STRING_TDB2_MISSING_TASK "Task with UUID {1} not found in data." -#define STRING_TDB2_UNDO_IMPOSSIBLE "No undo possible." +#define STRING_TDB2_UNDO_SYNCED "Cannot undo change because the task was already synced. Modify the task instead." // text // A comma-separated list of commands is appended. diff --git a/src/i18n.h b/src/i18n.h index 5df5ca3c8..5e49ab5f0 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -51,6 +51,8 @@ #include #elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE #include +#elif PACKAGE_LANGUAGE == LANGUAGE_IT_IT +#include #endif #define CCOLOR_BOLD 500 diff --git a/src/interactive.cpp b/src/interactive.cpp index d991caa2a..5a33c41d2 100644 --- a/src/interactive.cpp +++ b/src/interactive.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #ifdef SOLARIS #include diff --git a/src/it-IT.h b/src/it-IT.h new file mode 100644 index 000000000..f16e8b123 --- /dev/null +++ b/src/it-IT.h @@ -0,0 +1,1000 @@ +//////////////////////////////////////////////////////////////////////////////// +// taskwarrior - a command line task list manager. +// +// Copyright 2006-2014, 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 +// +//////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////// +// +// This file contains all the strings that should be localized. If a string is +// *not* in this file, then either: +// (a) it should not be localized, or +// (b) you have found a bug - please report it +// +// Strings that should be localized: +// - text output that the user sees +// +// Strings that should NOT be localized: +// - .taskrc configuration variable names +// - command names +// - extension function names +// - certain literals associated with parsing +// - debug strings +// - attribute names +// - modifier names +// - logical operators (and, or, xor) +// +// Rules: +// - Localized strings should not in general contain leading or trailing +// white space, including \n, thus allowing the code to compose strings. +// - Retain the tense of the original string. +// - Retain the same degree of verbosity of the original string. +// +//////////////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////////////// +// +// Translators: +// 1. Copy this file (en-US.h) to a new file with the target locale as the +// file name. Using German as an example, do this: +// +// cp en-US.h de-DE.h +// +// 2. Modify all the strings below. +// i.e. change "Unknown error." to "Unbekannter Fehler.". +// +// 3. Add your new translation to the task.git/src/i18n.h file, if necessary, +// by inserting: +// +// #elif PACKAGE_LANGUAGE == LANGUAGE_DE_DE +// #include +// +// 4. Add your new language to task.git/CMakeLists.txt, making sure that +// number is unique: +// +// set (LANGUAGE_DE_DE 3) +// +// 5. Add your new language to task.git/cmake.h.in: +// +// #define LANGUAGE_DE_DE ${LANGUAGE_DE_DE} +// +// 6. Build your localized Taskwarrior with these commands: +// +// cd task.git +// cmake -D LANGUAGE=3 . +// make +// +// 7. Submit your translation to support@taskwarrior.org, where it will be +// shared with others. +// +//////////////////////////////////////////////////////////////////////////////// + +#ifndef INCLUDED_STRINGS +#define INCLUDED_STRINGS +#define L10N // Localization complete. + +// Note that for English, the following two lines are not displayed. For all +// other localizations, these lines will appear in the output of the 'version' +// and 'diagnostics' commands. +// +// DO NOT include a copyright in the translation. +// +#define STRING_LOCALIZATION_DESC "Traduzione in Italiano" +#define STRING_LOCALIZATION_AUTHOR "Tradotto in Italiano da Tullio Facchinetti." + +// A3 +#define STRING_A3_ALTERNATE_RC "Uso del file .taskrc alternativo {1}" +#define STRING_A3_ALTERNATE_DATA "Uso di data.location alternativa {1}" +#define STRING_A3_OVERRIDE_RC "Modifica configurazione rc.{1}:{2}" +#define STRING_A3_OVERRIDE_PROBLEM "Problema di modifica: {1}" +#define STRING_A3_UNKNOWN_ATTMOD "Errore: modificatore di attributo non riconosciuto '{1}'." +#define STRING_A3_MISMATCHED_PARENS "Mancata corrispondenza nell'uso delle parentesi nell'espressione" +#define STRING_A3_PATTERN_GARBAGE "Carattere(i) non riconosciuto(i) alla fine del pattern." +#define STRING_A3_MALFORMED_PATTERN "Pattern malformato." +#define STRING_A3_MALFORMED_ID "ID malformato." +#define STRING_A3_MALFORMED_UUID "UUID malformato." +#define STRING_A3_ID_AFTER_HYPHEN "ID non riconosciuto dopo il trattino." +#define STRING_A3_RANGE_INVERTED "Intervallo invertito 'alto-basso' invece di 'basso-alto'" +#define STRING_A3_UUID_AFTER_COMMA "UUID non riconosciuto dopo la virgola." +#define STRING_A3_ZERO_ID "'{1}' is not a valid ID." + +// Color +#define STRING_COLOR_UNRECOGNIZED "Il colore '{1}' non è riconosciuto." + +// columns/Col* +#define STRING_COLUMN_BAD_NAME "Nome di colonna '{1}' non riconosciuto." +#define STRING_COLUMN_BAD_FORMAT "Formato di colonna '{1}.{2}' non riconosciuto" +#define STRING_COLUMN_LABEL_TASKS "Task" +#define STRING_COLUMN_LABEL_DEP "Dipendenze" +#define STRING_COLUMN_LABEL_DEP_S "Dip" +#define STRING_COLUMN_LABEL_DESC "Descrizione" +#define STRING_COLUMN_LABEL_DUE "Scadenza" +#define STRING_COLUMN_LABEL_END "Fine" +#define STRING_COLUMN_LABEL_ENTERED "Inserito" +#define STRING_COLUMN_LABEL_COUNT "Conteggio" +#define STRING_COLUMN_LABEL_COMPLETE "Completato" +#define STRING_COLUMN_LABEL_MOD "Modificato" +#define STRING_COLUMN_LABEL_ADDED "Aggiunto" +#define STRING_COLUMN_LABEL_AGE "Età" +#define STRING_COLUMN_LABEL_ID "ID" +#define STRING_COLUMN_LABEL_PRI "Pri" +#define STRING_COLUMN_LABEL_PRIORITY "Priorità" +#define STRING_COLUMN_LABEL_PROJECT "Progetto" +#define STRING_COLUMN_LABEL_UNTIL "Fino a" +#define STRING_COLUMN_LABEL_WAIT "Attesa" +#define STRING_COLUMN_LABEL_WAITING "Attesa fino" +#define STRING_COLUMN_LABEL_RECUR "Period" +#define STRING_COLUMN_LABEL_RECUR_L "Periodico" +#define STRING_COLUMN_LABEL_START "Inizio" +#define STRING_COLUMN_LABEL_STARTED "Iniziati" +#define STRING_COLUMN_LABEL_ACTIVE "A" +#define STRING_COLUMN_LABEL_STATUS "Stato" +#define STRING_COLUMN_LABEL_STAT "St" +#define STRING_COLUMN_LABEL_STAT_PE "Da fare" +#define STRING_COLUMN_LABEL_STAT_CO "Completati" +#define STRING_COLUMN_LABEL_STAT_DE "Cancellati" +#define STRING_COLUMN_LABEL_STAT_WA "In attesa" +#define STRING_COLUMN_LABEL_STAT_RE "Periodicamente" +#define STRING_COLUMN_LABEL_STAT_P "P" +#define STRING_COLUMN_LABEL_STAT_C "C" +#define STRING_COLUMN_LABEL_STAT_D "D" +#define STRING_COLUMN_LABEL_STAT_W "W" +#define STRING_COLUMN_LABEL_STAT_R "R" +#define STRING_COLUMN_LABEL_TAGS "Tags" +#define STRING_COLUMN_LABEL_TAG "Tag" +#define STRING_COLUMN_LABEL_UUID "UUID" +#define STRING_COLUMN_LABEL_URGENCY "Urgenza" +#define STRING_COLUMN_LABEL_NAME "Nome" +#define STRING_COLUMN_LABEL_VALUE "Valore" +#define STRING_COLUMN_LABEL_MASK "Maschera" +#define STRING_COLUMN_LABEL_MASK_IDX "Indice Maschera" +#define STRING_COLUMN_LABEL_PARENT "Task genitore" +#define STRING_COLUMN_LABEL_DATE "Data" +#define STRING_COLUMN_LABEL_COLUMN "Colonna" +#define STRING_COLUMN_LABEL_STYLES "Formati Supportati" +#define STRING_COLUMN_LABEL_EXAMPLES "Esempio" +#define STRING_COLUMN_LABEL_SCHED "Fissato" +#define STRING_COLUMN_LABEL_UDA "Nome" +#define STRING_COLUMN_LABEL_TYPE "Tipo" +#define STRING_COLUMN_LABEL_LABEL "Etichetta" +#define STRING_COLUMN_LABEL_DEFAULT "Predefinito" +#define STRING_COLUMN_LABEL_VALUES "Valori consentiti" +#define STRING_COLUMN_LABEL_UDACOUNT "Conteggio Uso" +#define STRING_COLUMN_LABEL_ORPHAN "UDA Orfano" + +// Column Examples +#define STRING_COLUMN_EXAMPLES_TAGS "casa @faccende next" +#define STRING_COLUMN_EXAMPLES_PROJ "casa.giardino" +#define STRING_COLUMN_EXAMPLES_PAR "casa" +#define STRING_COLUMN_EXAMPLES_IND " casa.giardino" +#define STRING_COLUMN_EXAMPLES_DESC "Spostare i vestiti sul gancio più basso" +#define STRING_COLUMN_EXAMPLES_ANNO1 "Immediatamente prima di pranzo" +#define STRING_COLUMN_EXAMPLES_ANNO2 "Se si sta giocando la partita questo pomeriggio" +#define STRING_COLUMN_EXAMPLES_ANNO3 "Prima di scrivere la lettera a casa" +#define STRING_COLUMN_EXAMPLES_ANNO4 "Se non si va a tagliare i capelli" + +// commands/Cmd* +#define STRING_CMD_CONFLICT "Report personalizzato '{1}' provoca conflitto con un comando standard." +#define STRING_CMD_VERSION_USAGE "Mostra il numero di versione di taskwarrior" +#define STRING_CMD_VERSION_USAGE2 "Mostra solo il numero di versione di taskwarrior" +#define STRING_CMD_VERSION_MIT "Taskwarrior può essere copiato solo nei termini della licenza MIT, reperibile nei sorgenti di taskwarrior." +#define STRING_CMD_VERSION_DOCS "La documentazione di taskwarrior è consultabile con 'man task', 'man taskrc', 'man task-tutorial', 'man task-color', 'man task-sync', 'man task-faq' o presso http://taskwarrior.org" +#define STRING_CMD_VERSION_BUILT "{1} {2} generato per " +#define STRING_CMD_VERSION_UNKNOWN "sconosciuto" +#define STRING_CMD_VERSION_COPY "Copyright (C) 2006 - 2014 P. Beckingham, F. Hernandez." +#define STRING_CMD_LOGO_USAGE "Mostra il logo di Taskwarrior" +#define STRING_CMD_LOGO_COLOR_REQ "Il comando logo richiede l'abilitazione del supporto ai colori." +#define STRING_CMD_EXEC_USAGE "Esegue comandi e script esterni" +#define STRING_CMD_URGENCY_USAGE "Mostra l'urgenza di un task" +#define STRING_CMD_URGENCY_RESULT "task {1} urgenza {2}" +#define STRING_CMD_ADD_USAGE "Aggiunge un nuovo task" +#define STRING_CMD_ADD_FEEDBACK "Task {1} creato." +#define STRING_CMD_ADD_BAD_ATTRIBUTE "Attributo '{1}' non riconosciuto." +#define STRING_CMD_LOG_USAGE "Aggiunge un nuovo task già completato" +#define STRING_CMD_LOG_NO_RECUR "Task periodici non possono essere registrati." +#define STRING_CMD_LOG_NO_WAITING "Task in attesa non possono essere registrati." +#define STRING_CMD_LOG_LOGGED "Task registrato." +#define STRING_CMD_IDS_USAGE_RANGE "Mostra gli ID dei task corrispondenti, come intervallo" +#define STRING_CMD_IDS_USAGE_LIST "Mostra gli ID dei task corrispondenti, in forma di lista" +#define STRING_CMD_IDS_USAGE_ZSH "Mostra gli ID e le descrizioni dei task corrispondenti" +#define STRING_CMD_UDAS_USAGE "Mostra tutti i dettagli degli UDA definiti" +#define STRING_CMD_UDAS_COMPL_USAGE "Mostra gli UDA definiti per il completamento" +#define STRING_CMD_UUIDS_USAGE_RANGE "Mostra gli UUID dei task corrispondenti, come lista separata da virgole" +#define STRING_CMD_UUIDS_USAGE_LIST "Mostra gli UUID dei task corrispondenti, come lista" +#define STRING_CMD_UUIDS_USAGE_ZSH "Mostra gli UUID e le descrizioni dei task corrispondenti" +#define STRING_CMD_EXPORT_USAGE "Esporta i task in formato JSON" +#define STRING_CMD_INFO_USAGE "Mostra tutti i dati e i metadati" +#define STRING_CMD_INFO_BLOCKED "Questo task è bloccato da" +#define STRING_CMD_INFO_BLOCKING "Questo task sta bloccando" +#define STRING_CMD_INFO_UNTIL "Fino a" +#define STRING_CMD_INFO_MODIFICATION "Modifica" +#define STRING_CMD_INFO_TOTAL_ACTIVE "Tempo totale di attività" +#define STRING_CMD_INFO_MODIFIED "Ultima modifica" +#define STRING_CMD_UNDO_USAGE "Ritorna alla più recente modifica di un task" +#define STRING_CMD_UNDO_MODS "Il comando undo non ammette ulteriori modifiche al task." +#define STRING_CMD_STATS_USAGE "Mostra le statistiche sul task" +#define STRING_CMD_STATS_CATEGORY "Categoria" +#define STRING_CMD_STATS_DATA "Dati" +#define STRING_CMD_STATS_TOTAL "Totale" +#define STRING_CMD_STATS_ANNOTATIONS "Annotazioni" +#define STRING_CMD_STATS_UNIQUE_TAGS "Tag univoci" +#define STRING_CMD_STATS_PROJECTS "Progetti" +#define STRING_CMD_STATS_DATA_SIZE "Dimensione dati" +#define STRING_CMD_STATS_UNDO_TXNS "Transazioni di undo" +#define STRING_CMD_STATS_BACKLOG "Sincronizza le transazioni di backlog" +#define STRING_CMD_STATS_TAGGED "Task taggati" +#define STRING_CMD_STATS_OLDEST "Task più vecchio" +#define STRING_CMD_STATS_NEWEST "Task più recente" +#define STRING_CMD_STATS_USED_FOR "Task usati per" +#define STRING_CMD_STATS_ADD_EVERY "Task aggiunti ogni" +#define STRING_CMD_STATS_COMP_EVERY "Task completati ogni" +#define STRING_CMD_STATS_DEL_EVERY "Task cancellati ogni" +#define STRING_CMD_STATS_AVG_PEND "Tempo medio di attesa" +#define STRING_CMD_STATS_DESC_LEN "Lunghezza media delle descrizioni" +#define STRING_CMD_STATS_CHARS "{1} caratteri" +#define STRING_CMD_STATS_LAST_SYNC "Ultima sincronizzazione" +#define STRING_CMD_STATS_BLOCKED "Task bloccati" +#define STRING_CMD_STATS_BLOCKING "Task bloccanti" +#define STRING_CMD_REPORTS_USAGE "Lista dei report supportati" +#define STRING_CMD_REPORTS_REPORT "Report" +#define STRING_CMD_REPORTS_DESC "Descrizione" +#define STRING_CMD_REPORTS_SUMMARY "{1} report" +#define STRING_CMD_TAGS_USAGE "Mostra la lista di tutti i tag utilizzati" +#define STRING_CMD_COMTAGS_USAGE "Mostra solo una lista dei tag utilizzati, per autocompletamento" +#define STRING_CMD_TAGS_SINGLE "1 tag" +#define STRING_CMD_TAGS_PLURAL "{1} tag" +#define STRING_CMD_TAGS_NO_TAGS "Nessun tag." +#define STRING_CMD_HISTORY_USAGE_M "Mostra un report dello storico dei task, per mese" +#define STRING_CMD_HISTORY_YEAR "Anno" +#define STRING_CMD_HISTORY_MONTH "Mese" +#define STRING_CMD_HISTORY_ADDED "Aggiunto" +#define STRING_CMD_HISTORY_COMP "Completato" +#define STRING_CMD_HISTORY_DEL "Cancellato" +#define STRING_CMD_HISTORY_NET "Bilancio" +#define STRING_CMD_HISTORY_USAGE_A "Mostra un report dello storico dei task, per anno" +#define STRING_CMD_HISTORY_AVERAGE "Media" +#define STRING_CMD_HISTORY_LEGEND "Legenda: {1}, {2}, {3}" +#define STRING_CMD_HISTORY_LEGEND_A "Legenda: + aggiunto, X completato, - cancellato" +#define STRING_CMD_GHISTORY_USAGE_M "Mostra un report grafico dello storico dei task, per mese" +#define STRING_CMD_GHISTORY_USAGE_A "Mostra un report grafico dello storico dei task, per anno" +#define STRING_CMD_GHISTORY_YEAR "Anno" +#define STRING_CMD_GHISTORY_MONTH "Mese" +#define STRING_CMD_GHISTORY_NUMBER "Aggiunti/Completati/Cancellati" + +#define STRING_CMD_DONE_USAGE "Contrassegna il task specificato come completato" +#define STRING_CMD_DONE_CONFIRM "Completare il task {1} '{2}'?" +#define STRING_CMD_DONE_TASK "Task completato {1} '{2}'." +#define STRING_CMD_DONE_NO "Task non completato." +#define STRING_CMD_DONE_NOTPEND "Il task {1} '{2}' non è ne' pendente ne' in attesa." +#define STRING_CMD_DONE_1 "Completato {1} task." +#define STRING_CMD_DONE_N "Completati {1} task." + +#define STRING_CMD_PROJECTS_USAGE "Mostra tutti i nomi di progetto utilizzati" +#define STRING_CMD_PROJECTS_USAGE_2 "Mostra solo i nomi di progetto utilizzati" +#define STRING_CMD_PROJECTS_NO "Nessun progetto." +#define STRING_CMD_PROJECTS_PRI_N "Pri:Nessuna" +#define STRING_CMD_PROJECTS_PRI_H "Pri:H" +#define STRING_CMD_PROJECTS_PRI_M "Pri:M" +#define STRING_CMD_PROJECTS_PRI_L "Pri:L" +#define STRING_CMD_PROJECTS_NONE "(nessuno)" +#define STRING_CMD_PROJECTS_SUMMARY "{1} progetto" +#define STRING_CMD_PROJECTS_SUMMARY2 "{1} progetti" +#define STRING_CMD_PROJECTS_TASK "({1} task)" +#define STRING_CMD_PROJECTS_TASKS "({1} task)" +#define STRING_CMD_SUMMARY_USAGE "Mostra un report dello stato dei task per progetto" +#define STRING_CMD_SUMMARY_PROJECT "Progetto" +#define STRING_CMD_SUMMARY_REMAINING "Rimanenti" +#define STRING_CMD_SUMMARY_AVG_AGE "Età media" +#define STRING_CMD_SUMMARY_COMPLETE "Completi" +#define STRING_CMD_SUMMARY_NONE "(nessuno)" +#define STRING_CMD_COUNT_USAGE "Conteggia task corrispondenti" +#define STRING_CMD_GET_USAGE "DOM Accessor" +#define STRING_CMD_GET_NO_DOM "No DOM reference specified." + +#define STRING_CMD_UDAS_NO "Nessun UDA definito." +#define STRING_CMD_UDAS_SUMMARY "{1} UDA definito" +#define STRING_CMD_UDAS_SUMMARY2 "{1} UDAs defined" +#define STRING_CMD_UDAS_ORPHAN "{1} UDA orfano" +#define STRING_CMD_UDAS_ORPHANS "{1} UDA orfani" + +#define STRING_CMD_DELETE_USAGE "Cancella il task specificato" +#define STRING_CMD_DELETE_CONFIRM "Cancellare permanentemente il task {1} '{2}'?" +#define STRING_CMD_DELETE_TASK "Cancellazione del task {1} '{2}'." +#define STRING_CMD_DELETE_TASK_R "Cancellazione del task periodico {1} '{2}'." +#define STRING_CMD_DELETE_CONFIRM_R "Questo è un task periodico. Cancellare tutti i task pendenti associati a queso task?" +#define STRING_CMD_DELETE_NO "Task non cancellato." +#define STRING_CMD_DELETE_NOT_DEL "Il task {1} '{2}' non può essere elminato." +#define STRING_CMD_DELETE_1 "Task {1} cancellato." +#define STRING_CMD_DELETE_N "Task {1} cancellati." + +#define STRING_CMD_DUPLICATE_USAGE "Duplica il task specificato" +#define STRING_CMD_DUPLICATE_REC "Nota: il task {1} genera task periodici. Il task duplicato anche." +#define STRING_CMD_DUPLICATE_NON_REC "Nota: il task {1} era un task periodico. Il task duplicato non lo è." +#define STRING_CMD_DUPLICATE_CONFIRM "Duplicare il task {1} '{2}'?" +#define STRING_CMD_DUPLICATE_TASK "Duplicated task {1} '{2}'." +#define STRING_CMD_DUPLICATE_NO "Task non duplicato" +#define STRING_CMD_DUPLICATE_1 "Task {1} duplicato." +#define STRING_CMD_DUPLICATE_N "Task {1} duplicati." + +#define STRING_CMD_START_USAGE "Contrassegna i task specificati come avviati" +#define STRING_CMD_START_NO "Task non avviato." +#define STRING_CMD_START_ALREADY "Task {1} '{2}' già avviati." +#define STRING_CMD_START_TASK "Avvio task {1} '{2}'." +#define STRING_CMD_START_CONFIRM "Avviare task {1} '{2}'?" +#define STRING_CMD_START_1 "Task {1} avviato." +#define STRING_CMD_START_N "Task {1} avviati." + +#define STRING_CMD_STOP_USAGE "Rimuove il tempo di 'avvio' dal task" +#define STRING_CMD_STOP_NO "Task non fermato." +#define STRING_CMD_STOP_ALREADY "Task {1} '{2}' non fermato." +#define STRING_CMD_STOP_TASK "Sto fermando il task {1} '{2}'." +#define STRING_CMD_STOP_CONFIRM "Fermare task {1} '{2}'?" +#define STRING_CMD_STOP_1 "Task {1} fermato." +#define STRING_CMD_STOP_N "Task {1} fermati." + +#define STRING_CMD_APPEND_USAGE "Aggiunge testo alla fine di una descrizione di un task esistente" +#define STRING_CMD_APPEND_1 "Aggiunta al task {1}." +#define STRING_CMD_APPEND_N "Aggiunte ai task {1}." +#define STRING_CMD_APPEND_TASK "Aggiunta al task {1} '{2}'." +#define STRING_CMD_APPEND_TASK_R "Aggiunta al task periodico {1} '{2}'." +#define STRING_CMD_APPEND_CONFIRM_R "Questo è un task periodico. Aggiungere il testo alla fine della descrizione di tutti i task associati?" +#define STRING_CMD_APPEND_CONFIRM "Aggiungere alla fine della descrizione del task {1} '{2}'?" +#define STRING_CMD_APPEND_NO "Aggiunta non effettuata." + +#define STRING_CMD_PREPEND_USAGE "Aggiunge testo all'inizio di una descrizione di un task esistente" +#define STRING_CMD_PREPEND_1 "Aggiunta al task {1}." +#define STRING_CMD_PREPEND_N "Aggiunte ai task {1}." +#define STRING_CMD_PREPEND_TASK "Aggiunta al task {1} '{2}'." +#define STRING_CMD_PREPEND_TASK_R "Aggiunta al task periodico {1} '{2}'." +#define STRING_CMD_PREPEND_CONFIRM_R "Questo è un task periodico. Aggiungere il testo all'inizio della descrizione di tutti i task associati?" +#define STRING_CMD_PREPEND_CONFIRM "Aggiungere all'inizio della descrizione del task {1} '{2}'?" +#define STRING_CMD_PREPEND_NO "Aggiunta non effettuata." + +#define STRING_CMD_ANNO_USAGE "Aggiunge una annotazione a un task esistente" +#define STRING_CMD_ANNO_CONFIRM "Aggiungere una annotazione al task {1} '{2}'?" +#define STRING_CMD_ANNO_TASK "Aggiunta al task {1} '{2}'." +#define STRING_CMD_ANNO_TASK_R "Aggiunta al task periodico {1} '{2}'." +#define STRING_CMD_ANNO_CONFIRM_R "Questo è un task periodico. Aggiungere una annotazione a tutti i task associati?" +#define STRING_CMD_ANNO_NO "Aggiunta non effettuata." +#define STRING_CMD_ANNO_1 "Aggiunta al task {1}." +#define STRING_CMD_ANNO_N "Aggiunte ai task {1}." + +#define STRING_CMD_COLUMNS_USAGE "Tutte le colonne e gli stili di formattazione" +#define STRING_CMD_COLUMNS_NOTE "* significa formato di default, quindi opzionale. Per esempio, 'due' e 'due.formatted' sono equivalenti." +#define STRING_CMD_COLUMNS_USAGE2 "Mostra solo una lista delle colonne supportate" +#define STRING_CMD_COLUMNS_ARGS "Può essere specificata solo una stringa di ricerca." + +#define STRING_CMD_DENO_USAGE "Cancella una annotazione" +#define STRING_CMD_DENO_WORDS "Una stringa di annotazione deve essere fornita." +#define STRING_CMD_DENO_NONE "Il task specificato non ha annotazioni che possano essere cancellate." +#define STRING_CMD_DENO_CONFIRM "Denotare il task {1} '{2}'?" +#define STRING_CMD_DENO_FOUND "Annotazione '{1}' trovata e cancellata." +#define STRING_CMD_DENO_NOMATCH "Nessuna annotazione da cancellare trovata per '{1}'." +#define STRING_CMD_DENO_NO "Annotazione non rimossa." +#define STRING_CMD_DENO_1 "Annotazione rimossa da task {1}." +#define STRING_CMD_DENO_N "Annotazioni rimosse da task {1}." + +#define STRING_CMD_IMPORT_USAGE "Importa file JSON" +#define STRING_CMD_IMPORT_SUMMARY "Importati {1} task." +#define STRING_CMD_IMPORT_NOFILE "Specificare il file da importare." +#define STRING_CMD_IMPORT_FILE "Importazione di '{1}'" +#define STRING_TASK_NO_DESC "Annotazione senza descrizione: {1}" +#define STRING_TASK_NO_ENTRY "Annotazione senza data di immissione: {1}" +#define STRING_CMD_SHELL_HELP1 "Inserisci un comando (es. 'list'), o premi 'Enter'." +#define STRING_CMD_SHELL_HELP2 "Non è necessario includere il comando 'task'." +#define STRING_CMD_SHELL_HELP3 "Inserisci 'quit' (o 'bye', 'exit') per terminare la sessione." +#define STRING_CMD_SYNC_USAGE "Sincronizza i dati con il Taskserver" +#define STRING_CMD_SYNC_NO_SERVER "Taskserver non configurato." +#define STRING_CMD_SYNC_BAD_CRED "Credenziali del Taskserver malformate." +#define STRING_CMD_SYNC_BAD_CERT "Taskserver certificate missing." +#define STRING_CMD_SYNC_BAD_KEY "Taskserver key missing." +#define STRING_CMD_SYNC_ADD " aggiunto {1} '{2}'" +#define STRING_CMD_SYNC_MOD "modificato {1} '{2}'" +#define STRING_CMD_SYNC_PROGRESS "Sincronizzazione con {1}" +#define STRING_CMD_SYNC_SUCCESS0 "Sincronizzazione effettuata." +#define STRING_CMD_SYNC_SUCCESS1 "Sincronizzazione effettuata. {1} modifiche caricate." +#define STRING_CMD_SYNC_SUCCESS2 "Sincronizzazione effettuata. {1} modifiche scaricate." +#define STRING_CMD_SYNC_SUCCESS3 "Sincronizzazione effettuata. {1} modifiche caricate, {2} modifiche scaricate." +#define STRING_CMD_SYNC_SUCCESS_NOP "Sincronizzazione effettuata. Nessuna modifica." +#define STRING_CMD_SYNC_FAIL_ACCOUNT "Sincronizzazione fallita. Credenziali non corrette o Taskserver non abilitato." +#define STRING_CMD_SYNC_FAIL_ERROR "Sincronizzazione fallita. Il Taskserver ha ritornato l'errore: {1} {2}" +#define STRING_CMD_SYNC_FAIL_CONNECT "Sincronizzazione fallita. Impossibile connettersi al Taskserver." +#define STRING_CMD_SYNC_BAD_SERVER "Sincronizzazione fallita. Impostazione di configurazione '{1}' malformata" +#define STRING_CMD_SYNC_NO_TLS "Taskwarrior was built without GnuTLS support. Sync is not available." +#define STRING_CMD_SYNC_INIT "Please confirm that you wish to upload all your pending tasks to the Taskserver" +#define STRING_CMD_SYNC_NO_INIT "Taskwarrior will not proceed with first-time sync initialization." +#define STRING_CMD_SYNC_RELOCATE0 "The server account has been relocated. Please update your configuration using:" +#define STRING_CMD_SYNC_RELOCATE1 "task config taskd.server {1}" +#define STRING_CMD_SYNC_BAD_CA "CA certificate not found." +#define STRING_CMD_SYNC_CONNECT "Could not connect to {1} {2}" +#define STRING_CMD_SYNC_HANDSHAKE "Handshake failed. {1}" +#define STRING_CMD_SYNC_NOMERGE "Task push/pull/merge is configured, deprecated, and does not work with 'sync'." +#define STRING_CMD_SYNC_TRUST_CA "You should either provide a CA certificate or override verification, but not both." +#define STRING_CMD_DIAG_USAGE "Dettagli su piattaforma, build e ambiente" +#define STRING_CMD_DIAG_PLATFORM "Piattaforma" +#define STRING_CMD_DIAG_UNKNOWN "" +#define STRING_CMD_DIAG_COMPILER "Compilatore" +#define STRING_CMD_DIAG_VERSION "Versione" +#define STRING_CMD_DIAG_CAPS "Caps" +#define STRING_CMD_DIAG_FEATURES "Caratteristiche della Build" +#define STRING_CMD_DIAG_BUILT "Generato" +#define STRING_CMD_DIAG_COMMIT "Commit" +#define STRING_CMD_DIAG_FOUND "(trovato)" +#define STRING_CMD_DIAG_MISSING "(mancante)" +#define STRING_CMD_DIAG_ENABLED "Abilitato" +#define STRING_CMD_DIAG_DISABLED "Disabilitato" +#define STRING_CMD_DIAG_CONFIG "Configurazione" +#define STRING_CMD_DIAG_EXTERNAL "Utility esterne" +#define STRING_CMD_DIAG_TESTS "Test" +#define STRING_CMD_DIAG_UUID_SCAN "Valutati {1} task per duplicazione UUID:" +#define STRING_CMD_DIAG_UUID_DUP "Trovato duplicato {1}" +#define STRING_CMD_DIAG_UUID_NO_DUP "Nessun duplicato trovato" +#define STRING_CMD_DIAG_NONE "-nessuno-" +#define STRING_CMD_PUSH_USAGE "Carica i file locali all'URL" +#define STRING_CMD_PUSH_SAME "Impossibile caricare i file se sorgente e destinazione coincidono." +#define STRING_CMD_PUSH_NONLOCAL "L'uri '{1}' non è una directory locale." +#define STRING_CMD_PUSH_TRANSFERRED "Task locali trasferiti su {1}" +#define STRING_CMD_PUSH_NO_URI "Nessun uri è stato specificato per il caricamento. Specificare o l'uri di una directory .task remota, oppure creare la voce 'push.default.uri' nel file .taskrc." +#define STRING_CMD_PULL_USAGE "Scaricati file dall'URL" +#define STRING_CMD_PULL_SAME "Impossibile scaricare i file se sorgente e destinazione coincidono." +#define STRING_CMD_PULL_TRANSFERRED "Task locali trasferiti da {1}" +#define STRING_CMD_PULL_NO_URI "Nessun uri è stato specificato per lo scaricamento. Specificare o l'uri di una directory .task remota, oppure creare la voce 'pull.default.uri' nel file .taskrc." +#define STRING_CMD_PULL_MISSING "Almeno uno dei file di database in '{1}' non è presente." +#define STRING_CMD_PULL_NOT_DIR "L'uri '{1}' non è una directory. Dimenticato il carattere '/'?" +#define STRING_CMD_HCOMMANDS_USAGE "Genera la lista di tutti i comandi, per autocompletamento" +#define STRING_CMD_ZSHCOMMANDS_USAGE "Genera la lista di tutti i comandi, per autocompletamento in zsh" +#define STRING_CMD_ALIASES_USAGE "Genera la lista di tutti gli alias, per autocompletamento" +#define STRING_CMD_INSTALL_USAGE "Installa estensioni e script esterni" + +#define STRING_CMD_MODIFY_USAGE1 "Modifica il task esistente usando gli argomenti specificati." +#define STRING_CMD_MODIFY_NO_DUE "Impossibile specificare un task periodico senza una data di scadenza." +#define STRING_CMD_MODIFY_REM_DUE "Impossibile eliminare una scadenza da un task periodico" +#define STRING_CMD_MODIFY_REC_ALWAYS "Impossibile rimuovere un evento da un task periodico." +#define STRING_CMD_MODIFY_TASK "Modifica del task {1} '{2}'." +#define STRING_CMD_MODIFY_TASK_R "Modifica del task periodico {1} '{2}'." +#define STRING_CMD_MODIFY_1 "Task {1} modificato." +#define STRING_CMD_MODIFY_N "Task {1} modificati." +#define STRING_CMD_MODIFY_NO "Task non modificato." +#define STRING_CMD_MODIFY_CONFIRM "Modificare il task {1} '{2}'?" +#define STRING_CMD_MODIFY_RECUR "Questo è un task periodico. Modificare tutti i task associati?" +#define STRING_CMD_MODIFY_NEED_TEXT "Testo aggiunti da specificare." + +#define STRING_CMD_COLOR_USAGE "Tutti i colori, un esempio, o una legenda" +#define STRING_CMD_COLOR_HERE "Coloti in uso:" +#define STRING_CMD_COLOR_COLOR "Colore" +#define STRING_CMD_COLOR_DEFINITION "Definizione" +#define STRING_CMD_COLOR_EXPLANATION "Usare questo comando per vedere come i colori sono visualizzati sul terminale in uso." +#define STRING_CMD_COLOR_16 "16-colori in uso (supporto per sottolineatura, grassetto, e sfondo):" +#define STRING_CMD_COLOR_256 "256-colori in uso (supporto per sottolineatura):" +#define STRING_CMD_COLOR_YOURS "Esempio:" +#define STRING_CMD_COLOR_BASIC "Colori base" +#define STRING_CMD_COLOR_EFFECTS "Effetti" +#define STRING_CMD_COLOR_CUBE "Cubo dei colori RGB" +#define STRING_CMD_COLOR_RAMP "Rampa dei grigi" +#define STRING_CMD_COLOR_TRY "Provare eseguendo '{1}'." +#define STRING_CMD_COLOR_OFF "Il colore è attualmente disabilitato nel file .taskrc. Per abilitarlo, rimuovi la linea 'color=off', o cambia 'off' in 'on'." +#define STRING_CMD_CONFIG_USAGE "Modifica le impostazioni nella configurazione dei task" +#define STRING_CMD_CONFIG_CONFIRM "Sei sicuro di voler cambiare il valore di '{1}' da '{2}' a '{3}'?" +#define STRING_CMD_CONFIG_CONFIRM2 "Sei sicuro di voler aggiungere '{1}' con valore '{2}'?" +#define STRING_CMD_CONFIG_CONFIRM3 "Sei sicuro di voler rimuovere '{1}'?" +#define STRING_CMD_CONFIG_NO_ENTRY "Nessuna voce '{1}' trovata." +#define STRING_CMD_CONFIG_FILE_MOD "File di configurazione {1} modificato." +#define STRING_CMD_CONFIG_NO_CHANGE "Nessuna modifica apportata." +#define STRING_CMD_CONFIG_NO_NAME "Specificare il nome di una variabile di configurazione da modificare." +#define STRING_CMD_HCONFIG_USAGE "Elenca le variabili di configurazione supportate, per autocompletamento" +#define STRING_CMD_CUSTOM_MISMATCH "Differente numero di colonne ed etichette per il report '{1}'." +#define STRING_CMD_CUSTOM_OLD_SORT "Campo di ordinamento '{1}' deprecato. Prego modificarlo in '{2}'." +#define STRING_CMD_CUSTOM_OLD_FIELD "Campo di report '{1}' deprecato. Prego modificarlo in '{2}'." +#define STRING_CMD_CUSTOM_SHOWN "{1} mostrato" +#define STRING_CMD_CUSTOM_COUNT "1 task" +#define STRING_CMD_CUSTOM_COUNTN "{1} task" +#define STRING_CMD_CUSTOM_TRUNCATED "troncato alla linea {1}" +#define STRING_CMD_TIMESHEET_USAGE "Sommario settimanale dei task completati e avviati" +#define STRING_CMD_TIMESHEET_STARTED "Avviati ({1} task)" +#define STRING_CMD_TIMESHEET_DONE "Completati ({1} task)" +#define STRING_CMD_MERGE_USAGE "Unisce i file remoti con i file locali" +#define STRING_CMD_MERGE_COMPLETE "Unione completata." +#define STRING_CMD_MERGE_CONFIRM "Caricare le modifiche effettuate in seguito all'unione su '{1}'?" +#define STRING_CMD_MERGE_NO_URI "Nessun uri è stato specificato per l'unione. Specificare o l'uri di una directory .task remota, oppure creare la voce 'merge.default.uri' nel file .taskrc." +#define STRING_CMD_BURN_USAGE_M "Mostra un grafico del lavoro da svolgere, per mese" +#define STRING_CMD_BURN_USAGE_W "Mostra un grafico del lavoro da svolgere, per settimana" +#define STRING_CMD_BURN_USAGE_D "Mostra un grafico del lavoro da svolgere, per giorno" +#define STRING_CMD_BURN_TITLE "Lavoro da svolgere" +#define STRING_CMD_BURN_TOO_SMALL "Finestra troppo piccola per mostrare il grafico." +#define STRING_CMD_BURN_DAILY "Giornaliero" +#define STRING_CMD_BURN_WEEKLY "Settimanale" +#define STRING_CMD_BURN_MONTHLY "Mensile" +#define STRING_CMD_BURN_STARTED "Avviato" // Must be 7 or fewer characters +#define STRING_CMD_BURN_DONE "Chiuso" // Must be 7 or fewer characters +#define STRING_CMD_BURN_PENDING "Da fare" // Must be 7 or fewer characters +#define STRING_CMD_BURN_NO_CONVERGE "No convergenza" +#define STRING_CMD_HELP_USAGE "Mostra questo testo di aiuto" +#define STRING_CMD_HELP_USAGE_LABEL "Uso:" +#define STRING_CMD_HELP_USAGE_DESC "Esegue rc.default.command, se specificato." +#define STRING_CMD_HELP_ALIASED "Sinonimo: '{1}'" +#define STRING_CMD_CAL_USAGE "Mostra un calendario, con i task da svolgere marcati" +#define STRING_CMD_CAL_BAD_MONTH "L'argomento '{1}' non è un mese valido." +#define STRING_CMD_CAL_BAD_ARG "Impossibile riconosce l'argomento '{1}'." +#define STRING_CMD_CAL_LABEL_DATE "Data" +#define STRING_CMD_CAL_LABEL_HOL "Festività" +#define STRING_CMD_CAL_SUN_MON "La variabile di configurazione 'weekstart' può solo contenere i valori 'Domenica' or 'Lunedì'." +#define STRING_CMD_EDIT_USAGE "Esegue un editor per la modifica diretta di un task" + +// Config +#define STRING_CONFIG_OVERNEST "File di configurazione annidato più di 10 livelli - deve trattarsi di un errore." +#define STRING_CONFIG_READ_INCLUDE "Impossibile leggere il file di inclusione '{1}'." +#define STRING_CONFIG_INCLUDE_PATH "E` possibile includere solo file con percorso assoluto, non '{1}'" +#define STRING_CONFIG_BAD_ENTRY "Voce malformata '{1}' nel file di configurazione." +#define STRING_CONFIG_BAD_WRITE "Impossibile scrivere su'{1}'." +#define STRING_CONFIG_DEPRECATED_US "Il file .taskrc contiene impostazioni di colore che usano sottolineature deprecate. Verificare:" +#define STRING_CONFIG_DEPRECATED_COL "Il file .taskrc contiene report con nomi di colonna deprecati. Verificare entry_time, start_time o end_time in:" +#define STRING_CONFIG_DEPRECATED_VAR "Il file .taskrc contiene variabili deprecate:" + +// Context +#define STRING_CONTEXT_CREATE_RC "Un file di configurazione non può essere trovato in {1}\n\nSi desidera la creazione di un file di esempio {2}, in modo che taskwarrior possa procedere?" +#define STRING_CONTEXT_NEED_RC "Impossibile procedere senza rc file." +#define STRING_CONTEXT_RC_OVERRIDE "Modifica TASKRC: {1}" +#define STRING_CONTEXT_DATA_OVERRIDE "Modifica TASKDATA: {1}" +#define STRING_CONTEXT_SHADOW_P "Variabile di configurazione 'shadow.file' impostata a " "sovrascrittura dei task pendenti. Si prega di modificarla." +#define STRING_CONTEXT_SHADOW_C "Variabile di configurazione 'shadow.file' impostata a " "sovrascrittura dei task completati. Si preda di modificarla." +#define STRING_CONTEXT_SHADOW_U "Variabile di configurazione 'shadow.file' impostata a " "sovrascrittura del log di undo. Si prega di modificarla." +#define STRING_CONTEXT_SHADOW_B "Variabile di configurazione 'shadow.file' impostata a " "sovrascrittura del file di backlog. Si prega di modificarla." +#define STRING_CONTEXT_SHADOW_UPDATE "[Shadow file '{1}' aggiornato.]" + +// Date +#define STRING_DATE_INVALID_FORMAT "'{1}' non è una data valida nel formato '{2}'." +#define STRING_DATE_BAD_WEEKSTART "La variabile di configurazione 'weekstart' può solo contenere 'Domenica' o 'Lunedì'." + +#define STRING_DATE_JANUARY_LONG "gennaio" +#define STRING_DATE_FEBRUARY_LONG "febbraio" +#define STRING_DATE_MARCH_LONG "marzo" +#define STRING_DATE_APRIL_LONG "aprile" +#define STRING_DATE_MAY_LONG "maggio" +#define STRING_DATE_JUNE_LONG "giugno" +#define STRING_DATE_JULY_LONG "luglio" +#define STRING_DATE_AUGUST_LONG "agosto" +#define STRING_DATE_SEPTEMBER_LONG "settembre" +#define STRING_DATE_OCTOBER_LONG "ottobre" +#define STRING_DATE_NOVEMBER_LONG "novembre" +#define STRING_DATE_DECEMBER_LONG "decembre" + +#define STRING_DATE_JANUARY_SHORT "gen" +#define STRING_DATE_FEBRUARY_SHORT "feb" +#define STRING_DATE_MARCH_SHORT "mar" +#define STRING_DATE_APRIL_SHORT "apr" +#define STRING_DATE_MAY_SHORT "mag" +#define STRING_DATE_JUNE_SHORT "giu" +#define STRING_DATE_JULY_SHORT "lug" +#define STRING_DATE_AUGUST_SHORT "ago" +#define STRING_DATE_SEPTEMBER_SHORT "set" +#define STRING_DATE_OCTOBER_SHORT "ott" +#define STRING_DATE_NOVEMBER_SHORT "nov" +#define STRING_DATE_DECEMBER_SHORT "dic" + +#define STRING_DATE_SUNDAY_LONG "domenica" +#define STRING_DATE_MONDAY_LONG "lunedì" +#define STRING_DATE_TUESDAY_LONG "martedì" +#define STRING_DATE_WEDNESDAY_LONG "mercoledì" +#define STRING_DATE_THURSDAY_LONG "giovedì" +#define STRING_DATE_FRIDAY_LONG "venerdì" +#define STRING_DATE_SATURDAY_LONG "sabato" + +#define STRING_DATE_SUNDAY_SHORT "dom" +#define STRING_DATE_MONDAY_SHORT "lun" +#define STRING_DATE_TUESDAY_SHORT "mar" +#define STRING_DATE_WEDNESDAY_SHORT "mer" +#define STRING_DATE_THURSDAY_SHORT "gio" +#define STRING_DATE_FRIDAY_SHORT "ven" +#define STRING_DATE_SATURDAY_SHORT "sab" + +// dependency +#define STRING_DEPEND_BLOCKED "Il task {1} è bloccato da:" +#define STRING_DEPEND_BLOCKING "e sta bloccando:" +#define STRING_DEPEND_FIX_CHAIN "Si desidera riparare la catena delle dipendenze?" + +// DOM +#define STRING_DOM_UNKNOWN "" +#define STRING_DOM_UNREC "DOM: Impossibile ottenere il nome non riconosciuto '{1}'." +#define STRING_DOM_CANNOT_SET "DOM: Impossibile impostare '{1}'." + +// Duration +#define STRING_DURATION_UNRECOGNIZED "La durata '{1}' non è valida, con nità corrette come '3days'." + +// E9 +#define STRING_E9_UNSUPPORTED "Operatore non supportato '{1}'." +#define STRING_E9_NO_OPERANDS "Non ci sono operandi per l'operatore '{1}'." +#define STRING_E9_INSUFFICIENT_OP "Non ci sono abbastanza operandi per l'operatore '{1}'." +#define STRING_E9_MORE_OP "Trovati operandi in eccesso." + +// edit +#define STRING_EDIT_NO_CHANGES "Nessuna modifica riscontrata." +#define STRING_EDIT_NO_EDITS "Nessuna modifica effettuata." +#define STRING_EDIT_COMPLETE "Modifica completa." +#define STRING_EDIT_LAUNCHING "Esecuzione di '{1}' ora..." +#define STRING_EDIT_CHANGES "Modifiche rilevate." +#define STRING_EDIT_UNPARSEABLE "Taskwarrior non può gestire le modifiche. Provare di nuovo?" +#define STRING_EDIT_UNWRITABLE "La directory data.location non è scrivibile." +#define STRING_EDIT_TAG_SEP "Separare i tag con spazi; es.: tag1 tag2" +#define STRING_EDIT_DEP_SEP "Le dipendenze dovrebbero consistere in una lista separata da virgole di ID/UUID o intervalli di ID, senza spazi." +#define STRING_EDIT_UDA_SEP "User Defined Attribute" +#define STRING_EDIT_UDA_ORPHAN_SEP "User Defined Attribute orfani" +#define STRING_EDIT_END "Fine" + +#define STRING_EDIT_PROJECT_MOD "Progetto modificato." +#define STRING_EDIT_PROJECT_DEL "Progetto cancellato." +#define STRING_EDIT_PRIORITY_MOD "Progetto modificato." +#define STRING_EDIT_PRIORITY_DEL "Priorità cancellata." +#define STRING_EDIT_DESC_MOD "Descrizione modificata." +#define STRING_EDIT_DESC_REMOVE_ERR "Impossibile rimuovere la descrizione." +#define STRING_EDIT_ENTRY_REMOVE_ERR "Impossibile rimuovere la data di creazione." +#define STRING_EDIT_ENTRY_MOD "Data di creazione modificata." +#define STRING_EDIT_START_MOD "Data di inizio modificata." +#define STRING_EDIT_START_DEL "Data di inizio rimossa." +#define STRING_EDIT_END_MOD "Data di fine modificata." +#define STRING_EDIT_END_DEL "Data di fine rimossa." +#define STRING_EDIT_END_SET_ERR "Impossibile impostare la data di chiusura del task pendente." +#define STRING_EDIT_SCHED_MOD "Data di schedulazione modificata." +#define STRING_EDIT_SCHED_DEL "Data di schedulazione rimossa." +#define STRING_EDIT_DUE_MOD "Scadenza modificata." +#define STRING_EDIT_DUE_DEL "Scadenza rimossa." +#define STRING_EDIT_DUE_DEL_ERR "Impossibile rimuovere la data di scadenza di un task periodico." +#define STRING_EDIT_UNTIL_MOD "Data 'Fino a' modificata." +#define STRING_EDIT_UNTIL_DEL "Data 'Fino a' rimossa." +#define STRING_EDIT_RECUR_MOD "Ricorrenza periodica modificata." +#define STRING_EDIT_RECUR_DEL "Ricorrenza periodica rimossa." +#define STRING_EDIT_RECUR_DUE_ERR "Un task periodico deve avere una data di scadenza." +#define STRING_EDIT_RECUR_ERR "Durata del task periodico non valida." +#define STRING_EDIT_WAIT_MOD "Data di attesa modificata." +#define STRING_EDIT_WAIT_DEL "Data di attesa rimossa." +#define STRING_EDIT_PARENT_MOD "UUID genitore modificato." +#define STRING_EDIT_PARENT_DEL "UUID genitore rimosso." +#define STRING_EDIT_UDA_MOD "UDA {1} modificato." +#define STRING_EDIT_UDA_DEL "UDA {1} cancellato." + +// These four blocks can be replaced, but the number of lines must not change. +#define STRING_EDIT_HEADER_1 "Il comando 'task edit' permette di modificare ogni aspetto di un task" +#define STRING_EDIT_HEADER_2 "utilizzando un editor di testo. Segue la rappresentazione dei dettagli di un task." +#define STRING_EDIT_HEADER_3 "Modificare quanto desiderato, e quando si salva e si esce dall'editor," +#define STRING_EDIT_HEADER_4 "taskwarrior leggerà il file, determinando ciò che è cambiato, e applicherà" +#define STRING_EDIT_HEADER_5 "le modifiche. Se si esce dall'editor senza salvare o effettuare" +#define STRING_EDIT_HEADER_6 "modifiche, taskwarrior non farà alcunché." + +#define STRING_EDIT_HEADER_7 "Le linee che iniziano con # rappresentano dati che non possono essere modificati, come l'ID." +#define STRING_EDIT_HEADER_8 "Se si è troppo creativi con le modifiche, taskwarrior aprirà" +#define STRING_EDIT_HEADER_9 "nuovamente l'editor per un secondo tentativo." + +#define STRING_EDIT_HEADER_10 "Se ci si trova in un ciclo senza fine, continuando a editare lo stesso file," +#define STRING_EDIT_HEADER_11 "si chiuda semplicemente l'editor senza effettuare modifiche. Taskwarrior" +#define STRING_EDIT_HEADER_12 "se ne accorgerà e terminerà l'editing." + +#define STRING_EDIT_HEADER_13 "Le annotazioni sono del tipo: -- e possono essere in numero arbitrario." +#define STRING_EDIT_HEADER_14 "Il separatore ' -- ' tra la data e il campo di teso non dovrebbe essere rimosso." +#define STRING_EDIT_HEADER_15 "Una linea preimpostata per aggiungere una annotazione è stata aggiunta per comodità." + +// Maintain the same spacing. +#define STRING_EDIT_TABLE_HEADER_1 "Nome Dati modificabili" +#define STRING_EDIT_TABLE_HEADER_2 "----------------- ----------------------------------------------------" + +// Errors +// TODO Move each of these to appropriate section. +#define STRING_ERROR_PREFIX "Errore: " +#define STRING_UNKNOWN_ERROR "Errore sconosciuto." +#define STRING_TRIVIAL_INPUT "Specificare un comando o un task da modificare" +#define STRING_ASSUME_INFO "Nessun comando specificato - si assume 'information'." +#define STRING_INFINITE_LOOP "Sostituzione terminata poiché più di {1} modifiche sono state fatte - protezione da ciclo infinito" +#define STRING_UDA_TYPE "Gli User defined attribute possono solo essere di tipo 'string', 'date', 'duration' o 'numeric'." +#define STRING_UDA_TYPE_MISSING "uda.{1}.type non trovato. L'UDA '{1}' deve avere un tipo specificato." +#define STRING_UDA_NUMERIC "Il valore '{1}' non è un valore numerico valido." +#define STRING_UDA_COLLISION "L'UDA '{1}' ha lo stesso nome di un attributo di sistema, e ciò non è permesso." +#define STRING_INVALID_MOD "L'attributo '{1}' non ammette un valore pari a '{2}'." +#define STRING_INVALID_SORT_COL "La colonna '{1}' non è un campo di ordinamento valido." +#define STRING_TLS_INIT_FAIL "Error initializing TLS." + +// Feedback +#define STRING_FEEDBACK_NO_TASKS "Nessun task." +#define STRING_FEEDBACK_NO_TASKS_SP "Nessun task specificat." +#define STRING_FEEDBACK_NO_MATCH "Nessuna corrispondenza." +#define STRING_FEEDBACK_TASKS_SINGLE "(1 task)" +#define STRING_FEEDBACK_TASKS_PLURAL "({1} task)" +#define STRING_FEEDBACK_DELETED "{1} sarà cancellato." +#define STRING_FEEDBACK_DEP_SET "Le dipendenze saranno impostate a '{1}'." +#define STRING_FEEDBACK_DEP_MOD "Le dipendenze saranno modificate da '{1}' in '{2}'." +#define STRING_FEEDBACK_DEP_DEL "Dipendenze '{1}' cancellate." +#define STRING_FEEDBACK_DEP_WAS_SET "Dipendenze impostate a '{1}'." +#define STRING_FEEDBACK_DEP_WAS_MOD "Dipendenze cambiate da '{1}' a '{2}'." +#define STRING_FEEDBACK_ATT_SET "{1} sarà impostata a '{2}'." +#define STRING_FEEDBACK_ATT_MOD "{1} sarà modificata da '{2}' a '{3}'." +#define STRING_FEEDBACK_ATT_DEL "{1} cancellato." +#define STRING_FEEDBACK_ATT_DEL_DUR "{1} cancellato (durata: {2})." +#define STRING_FEEDBACK_ATT_WAS_SET "{1} impostata a '{2}'." +#define STRING_FEEDBACK_ATT_WAS_MOD "{1} modificata da '{2}' a '{3}'." +#define STRING_FEEDBACK_ANN_ADD "Annotazione di '{1}' aggiunta." +#define STRING_FEEDBACK_ANN_DEL "Annotazione '{1}' cancellata." +#define STRING_FEEDBACK_ANN_WAS_MOD "Annotazione modificata in '{1}'." +#define STRING_FEEDBACK_NOP "Nessuna modifica sarà apportata." +#define STRING_FEEDBACK_WAS_NOP "Nessuna modifica apportata." +#define STRING_FEEDBACK_TAG_NOCOLOR "Il tag speciale 'nocolor' disabilita le regole dei colori per questo task." +#define STRING_FEEDBACK_TAG_NONAG "Il tag speciale 'nonag' eviterà problemi quando il task è modificato." +#define STRING_FEEDBACK_TAG_NOCAL "Il tag speciale 'nocal' manterrà il task fuori dal report 'calendar'." +#define STRING_FEEDBACK_TAG_NEXT "Il tag speciale 'next' aumenterà l'urgenza di questo task in modo che appaia nel report 'next'." +#define STRING_FEEDBACK_UNBLOCKED "Sbloccato {1} '{2}'." +#define STRING_FEEDBACK_EXPIRED "Il task {1} '{2}' è scaduto ed è stato eliminato" + +// File +#define STRING_FILE_PERMS "Taskwarrior non dispone dei permessi corretti per '{1}'." + +// helpers +#define STRING_HELPER_PROJECT_CHANGE "Il progetto '{1}' è stato modificat." +#define STRING_HELPER_PROJECT_COMPL "Il progetto '{1}' è {2}% completo" +#define STRING_HELPER_PROJECT_REM "({1} di {2} task rimanenti)." + +// interactive +#define STRING_INTERACTIVE_WIDTH "Context::getWidth: determinata larghezza di {1} caratteri" +#define STRING_INTERACTIVE_HEIGHT "Context::getHeight: determinata altezza di {1} caratteri" + +// JSON +#define STRING_JSON_MISSING_VALUE "Errore: mancato valore dopo ',' alla posizione {1}" +#define STRING_JSON_MISSING_VALUE2 "Errore: mancato valore alla posizione {1}" +#define STRING_JSON_MISSING_BRACKET "Errore: mancato ']' alla posizione {1}" +#define STRING_JSON_MISSING_BRACE "Errore: mancato '}' alla posizione {1}" +#define STRING_JSON_MISSING_COLON "Errore: mancato ':' alla posizione {1}" +#define STRING_JSON_MISSING_OPEN "Errore: atteso '{' o '[' alla posizione {1}" +#define STRING_JSON_EXTRA_CHARACTERS "Errore: caratteri in eccesso alla posizione {1}" + +// Record +#define STRING_RECORD_EMPTY "Voce vuota in ingresso." +#define STRING_RECORD_JUNK_AT_EOL "Carattere non riconosciuto a fine riga." +#define STRING_RECORD_NOT_FF4 "Voce non riconosciuta come formato 4." + +// 'show' command +#define STRING_CMD_SHOW "Mostra i sottoinsiemi di variabili di configurazione" +#define STRING_CMD_SHOW_ARGS "Solo 'all' può essere specificata come stringa di ricerca." +#define STRING_CMD_SHOW_NONE "Variabile di configurazione non corrispondente." +#define STRING_CMD_SHOW_UNREC "Il file .taskrc contiene variabili non riconosciute:" +#define STRING_CMD_SHOW_DIFFER "Alcune variabili in .taskrc hanno valore diverso dal default." +#define STRING_CMD_SHOW_EMPTY "Errore di configurazione: .taskrc è vuoto." +#define STRING_CMD_SHOW_DIFFER_COLOR "Evidenziate sopra in {1}." +#define STRING_CMD_SHOW_CONFIG_ERROR "Errore di configurazione: {1} contiene un valore non riconosciuto '{2}'." +#define STRING_CMD_SHOW_NO_LOCATION "Errore di configurazione: data.location non specificato in .taskrc." +#define STRING_CMD_SHOW_LOC_EXIST "Errore di configurazione: data.location contiene una directory che non esiste o non è leggibile." +#define STRING_CMD_SHOW_CONF_VAR "Variabile di configurazione" +#define STRING_CMD_SHOW_CONF_VALUE "Valore" +#define STRING_CMD_SHOWRAW "Mostra le impostazioni di configurazione in formato processabile" + +// Task +#define STRING_TASK_NO_FF1 "Taskwarrior non supporta più il formato di file 1, usato tra il 27 Novembre 2006 e il 31 Dicembre 2007." +#define STRING_TASK_NO_FF2 "Taskwarrior no longer supports file format 2, originally used between 1 January 2008 and 12 April 2009." +#define STRING_TASK_PARSE_ANNO_BRACK "Parentesi di annotazione mancanti." +#define STRING_TASK_PARSE_ATT_BRACK "Parentesi di attributo mancanti." +#define STRING_TASK_PARSE_TAG_BRACK "Parentesi di tag mancanti." +#define STRING_TASK_PARSE_TOO_SHORT "Linea troppo breve." +#define STRING_TASK_PARSE_UNREC_FF "Formato di file non riconosciuto." +#define STRING_TASK_DEPEND_ITSELF "Un task non può dipendere da sè stesso." +#define STRING_TASK_DEPEND_MISS_CREA "Impossibile creare la dipendenza dal task {1} - non trovato." +#define STRING_TASK_DEPEND_MISS_DEL "Impossibile cancellare la dipendenza dal task {1} - non trovato." +#define STRING_TASK_DEPEND_DUP "Task {1} già dipende da {2}." +#define STRING_TASK_DEPEND_CIRCULAR "Dipendenza circolare riscontrata ed evitata." +#define STRING_TASK_VALID_DESC "Un task deve avere una descrizione." +#define STRING_TASK_VALID_BLANK "Impossibile aggiungere un task vuoto." +#define STRING_TASK_VALID_BEFORE "Warning: data '{1}' con valore successivo alla data '{2}'." +#define STRING_TASK_VALID_REC_DUE "Un task periodico deve avere una data di scadenza." +#define STRING_TASK_VALID_RECUR "Il valore di periodicità '{1}' non è valido." +#define STRING_TASK_VALID_PRIORITY "I valori di priorità possono essere 'H', 'M' o 'L', non '{1}'." +#define STRING_TASK_SAFETY_VALVE "Questo comando non ha filtro, e modificherà tutti i task. Sicuro?" +#define STRING_TASK_SAFETY_FAIL "Prevenuta l'esecuzione del comando." + +// Taskmod +#define STRING_TASKMOD_BAD_INIT "Taskmod::getUuid(): oggetto Task non inizializzato." +#define STRING_TASKMOD_TIME "tempo " +#define STRING_TASKMOD_OLD "vecchio " +#define STRING_TASKMOD_NEW "nuovo " + +// TDB2 +#define STRING_TDB2_PARSE_ERROR " in {1} alla linea {2}" +#define STRING_TDB2_UUID_NOT_UNIQUE "Impossibile aggiungere il task in quanto l'uuid '{1}' non è unico." +#define STRING_TDB2_UNDO_TIMESTAMP "Problema di lettura del timestamp dal file undo.data." +#define STRING_TDB2_UNREADABLE "Impossibile leggere '{1}'." +#define STRING_TDB2_UNWRITABLE "Impossibile scrivere '{1}'." +#define STRING_TDB2_NO_CHANGES "Nessuna modifica da unire." +#define STRING_TDB2_REMOTE_CHANGE "Trovata modifica remota a {1} \"{2}\"" +#define STRING_TDB2_LOCAL_CHANGE "Mantenute le modifiche locali a {1} \"{2}\"" +#define STRING_TDB2_MISSING "Mancante {1} \"{2}\"" +#define STRING_TDB2_MERGING "Unione di nuovi task remoti {1} \"{2}\"" +#define STRING_TDB2_UP_TO_DATE "Il database è aggiornato, unione non necessaria." +#define STRING_TDB2_NO_UNDO "Nessuna transazione memorizzata da ripristinare." +#define STRING_TDB2_LAST_MOD "L'ultima modifica è stat effettuata {1}" +#define STRING_TDB2_UNDO_PRIOR "Valori precedenti" +#define STRING_TDB2_UNDO_CURRENT "Valori correnti" +#define STRING_TDB2_DIFF_PREV "--- stato precedente" // Same length +#define STRING_TDB2_DIFF_PREV_DESC "L'undo ripristinerà questo stato" // || +#define STRING_TDB2_DIFF_CURR "+++ stato corrente " // Same length +#define STRING_TDB2_DIFF_CURR_DESC "Modifiche effettuate {1}" +#define STRING_TDB2_UNDO_CONFIRM "Il comando undo non è reversibile. Sicuro di voler ripristinare lo stato precedente?" +#define STRING_TDB2_MISSING_UUID "Impossibile individuare l'UUID nel task da ripristinare." +#define STRING_TDB2_REVERTED "Modifiche al task ripristinate." +#define STRING_TDB2_REMOVED "Task rimosso." +#define STRING_TDB2_UNDO_COMPLETE "Undo completato." +#define STRING_TDB2_UNDO_SYNCED "Cannot undo change because the task was already synced. Modify the task instead." + +// text + // A comma-separated list of commands is appended. +#define STRING_TEXT_AMBIGUOUS "Ambiguo {1} '{2}' - può essere uno di " + +// Transport +#define STRING_TRANSPORT_NORUN "Impossibile eseguire '{1}'. E` installato e disponibile in $PATH?" +#define STRING_TRANSPORT_NOFORK "Impossibile eseguire '{1}': {2}. Risorse di sistema esaurite?" +#define STRING_TRANSPORT_URI_NODIR "L'uri '{1}' non appare essere una directory." +#define STRING_TRANSPORT_CURL_URI "Usando il protocollo 'curl', l'uri deve contenere il nome di un host." +#define STRING_TRANSPORT_CURL_WILDCD "Usando il protocollo 'curl', i caratteri jolly non sono supportati." +#define STRING_TRANSPORT_CURL_FAIL "Curl ha fallito, vedi l'output precedente." +#define STRING_TRANSPORT_RSYNC_URI "Usando il protocollo 'rsync', l'uri deve contenere un nome di host." +#define STRING_TRANSPORT_RSYNC_FAIL "rsync ha fallito, vedi l'output precedente." +#define STRING_TRANSPORT_SSH_URI "Usando il protocollo 'ssh', l'uri deve contenere un nome di host." +#define STRING_TRANSPORT_SSH_FAIL "ssh ha fallito, vedi l'output precedente." +#define STRING_TRANSPORT_SHELL_NOPATH "Usando il protocollo 'sh+cp' per la copia di più file, un percorso deve essere specificato." +#define STRING_TRANSPORT_SHELL_FAIL "Comando di shell ha fallito, vedi l'output precedente." + +// Uri +#define STRING_URI_QUOTES "Impossibile parsare l'uri '{1}', uso errato del singolo apice." +#define STRING_URI_BAD_FORMAT "L'uri '{1}' non è nel formato atteso." + +// utf8 +#define STRING_UTF8_INVALID_CP_REP "Rappresentazione non valida del codepoint." +#define STRING_UTF8_INVALID_CP "Codepoint Unicode non valido." + +// View +#define STRING_VIEW_TOO_SMALL "Il report ha larghezza minima di {1} e non entra nella larghezza disponibile di {2}." + +// Usage text. This is an exception, and contains \n characters and formatting. +#define STRING_CMD_HELP_TEXT \ + "La documentazione di Taskwarrior può essere consultata con 'man task', 'man taskrc', 'man " \ + "task-tutorial', 'man task-color', 'man task-faq', 'man task-synch o presso " \ + "http://taskwarrior.org\n" \ + "\n" \ + "La forma generale del comando è:\n" \ + " task [] []\n" \ + "\n" \ + " considte di zero o più condizioni sui task da selezionare, " \ + "come:\n" \ + " task \n" \ + " task 28 \n" \ + " task +weekend \n" \ + " task project:Home due.before:today \n" \ + " task ebeeab00-ccf8-464b-8b58-f7f2d606edfb \n" \ + "\n" \ + "Di default, i filtri sono combinati implicitamente con un operatore 'and', ma " \ + "'or' e 'xor' possono essere usati includendo le parentesi:\n" \ + " task '(/[Cc]at|[Dd]og/ or /[0-9]+/)' \n" \ + "\n" \ + "Un filtro può far riferimento a task specifici usando gli ID o UUID. Per specificare " \ + "più task una delle seguenti forme può essere usata:\n" \ + " task 1,2,3 delete\n" \ + " task 1-3 info\n" \ + " task 1,2-5,19 modify pri:H\n" \ + " task 4-7 ebeeab00-ccf8-464b-8b58-f7f2d606edfb info\n" \ + "\n" \ + " consiste di zero o più modifiche da applicare ai task selezionati, " \ + "come:\n" \ + " task project:Home\n" \ + " task +weekend +garden due:tomorrow\n" \ + " task Description/annotation text\n" \ + "\n" \ + "I tag sono parole arbitrarie, in quantità a discrezione dell'utente:\n" \ + " +tag Il + aggiunge il tag\n" \ + " -tag Il - rimuove il tag\n" \ + "\n" \ + "Gli attributi standard sono:\n" \ + " description: Testo di descrizione del task\n" \ + " status: Stato del task - pending, completed, deleted, waiting\n" \ + " project: Nome del progetto\n" \ + " priority: Priorità\n" \ + " due: Scadenza\n" \ + " recur: Frequenza di un task periodico\n" \ + " until: Data oltre la quale il task non è più valido\n" \ + " limit: Numero di righe desiderate in un report, o 'pagina'\n" \ + " wait: Data dalla quale un task diviene pending\n" \ + " entry: Data di creazione del task\n" \ + " end: Data di completamento/cancellazione del task\n" \ + " start: Data di inizio del task\n" \ + " scheduled: Data prevista per l'avvio del task\n" \ + " depends: Altri task dai quali dipende il task\n" \ + "\n" \ + "I modificatori rendono i filtri più precisi. Modificatori supportati sono:\n" \ + " before (sinomimi: under, below)\n" \ + " after (sinomimi: over, above)\n" \ + " none\n" \ + " any\n" \ + " is (sinomimo: equals)\n" \ + " isnt (sinomimo: not)\n" \ + " has (sinomimo: contains)\n" \ + " hasnt\n" \ + " startswith (sinomimo: left)\n" \ + " endswith (sinomimo: right)\n" \ + " word\n" \ + " noword\n" \ + "\n" \ + "Sono supportati i seguenti operatori:\n" \ + " and or xor Operatori logici\n" \ + " < <= = != >= > Operatori relazionali\n" \ + " ( ) Precedenza\n" \ + "\n" \ + " task due.before:eom priority.not:L list\n" \ + " task '(due < eom or priority != L)' list\n" \ + "\n" \ + "Il file .taskrc di default può essere reimpostato con:\n" \ + " task ... rc: ...\n" \ + " task ... rc:~/.alt_taskrc ...\n" \ + "\n" \ + "I valori di default nel file .taskrc possono essere modificati con:\n" \ + " task ... rc.= ...\n" \ + " task rc.color=off list\n" \ + "\n" \ + "Ogni comando o attributo può essere abbreviato se l'abbreviazione è unica:\n" \ + " task list project:Home\n" \ + " task li pro:Home\n" \ + "\n" \ + "Talune descrizioni richiedono i caratteri di escape per non confondere la shell:\n" \ + " task add \"quoted ' quote\"\n" \ + " task add escaped \\' quote\n" \ + "\n" \ + "L'argomento -- comunica a taskwarrior di trattare i rimanenti argomenti come descrizione, anche " \ + "se coincidono con attributi o task:\n" \ + " task add -- project:Home needs scheduling\n" \ + "\n" \ + "Diversi caratteri hanno significato speciale per la shell, incluso:\n" \ + " $ ! ' \" ( ) ; \\ ` * ? { } [ ] < > | & % # ~\n" \ + "\n" + +/* + To be included later, before the 'precendence' line. + + " + - Addition, subtraction\n" \ + " ! Inversion\n" \ + " ~ !~ Match, no match\n" \ +*/ + +// util +#define STRING_UTIL_CONFIRM_YN " (si/no) " +#define STRING_UTIL_CONFIRM_YES "si" +#define STRING_UTIL_CONFIRM_YES_U "Si" +#define STRING_UTIL_CONFIRM_NO "no" +#define STRING_UTIL_CONFIRM_ALL "tutti" +#define STRING_UTIL_CONFIRM_ALL_U "Tutti" +#define STRING_UTIL_CONFIRM_QUIT "esci" +#define STRING_UTIL_GIBIBYTES "Gb" +#define STRING_UTIL_MEBIBYTES "Mb" +#define STRING_UTIL_KIBIBYTES "Kb" +#define STRING_UTIL_BYTES "B" + +// shell +#define STRING_SHELL_USAGE \ + "Uso: tasksh [] Esegue i comandi all'interno di se fornito,\n" \ + " oppure avvia la shell interattiva.\n" \ + " tasksh --version Stampa la versione di task.\n" \ + " tasksh --help Stampa questo aiuto.\n" + +#define STRING_SHELL_NO_FILE "Il file di input non esiste.\n" + +#endif + diff --git a/src/legacy.cpp b/src/legacy.cpp index c678412fd..bfc77e865 100644 --- a/src/legacy.cpp +++ b/src/legacy.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -148,6 +149,12 @@ std::string legacyCheckForDeprecatedVariables () it->first.substr (it->first.length () - 12) == ".annotations") deprecated.push_back (it->first); + // {push,pull,merge}.uri Deprecated in 2.3.0 + if ((it->first.substr (0, 5) == "push." || + it->first.substr (0, 5) == "pull." || + it->first.substr (0, 6) == "merge.") && (it->first.find (".uri") != std::string::npos)) + deprecated.push_back (it->first); + if (it->first == "next" || it->first == "annotations" || it->first == "export.ical.class") diff --git a/src/main.cpp b/src/main.cpp index 5620b259d..c61615a0a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,38 +25,17 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include -#include - -#ifdef CYGWIN -#include -#else -#include -#endif - #include #include -#include Context context; -#ifdef HAVE_SRANDOM -#define srand(x) srandom(x) -#endif - //////////////////////////////////////////////////////////////////////////////// int main (int argc, const char** argv) { - // Set up randomness. -#ifdef CYGWIN - srand (time (NULL)); -#else - struct timeval tv; - gettimeofday (&tv, NULL); - srand (tv.tv_usec); -#endif - int status = 0; if (argc == 2 && !strcmp (argv[1], "--version")) diff --git a/src/main.h b/src/main.h index 89a54c180..39c2029e7 100644 --- a/src/main.h +++ b/src/main.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -38,7 +38,6 @@ #include #include #include -#include // recur.cpp void handleRecurrence (); diff --git a/src/recur.cpp b/src/recur.cpp index a4ba01bbc..ad09665d6 100644 --- a/src/recur.cpp +++ b/src/recur.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/rules.cpp b/src/rules.cpp index 093a73f4c..5174c70ab 100644 --- a/src/rules.cpp +++ b/src/rules.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -47,17 +48,15 @@ void initializeColorRules () // Load all the configuration values, filter to only the ones that begin with // "color.", then store name/value in gsColor, and name in rules. std::vector rules; - std::vector variables; - context.config.all (variables); - std::vector ::iterator v; - for (v = variables.begin (); v != variables.end (); ++v) + Config::const_iterator v; + for (v = context.config.begin (); v != context.config.end (); ++v) { - if (v->substr (0, 6) == "color.") + if (v->first.substr (0, 6) == "color.") { - Color c (context.config.get (*v)); - gsColor[*v] = c; + Color c (v->second); + gsColor[v->first] = c; - rules.push_back (*v); + rules.push_back (v->first); } } diff --git a/src/shell/Readline.cpp b/src/shell/Readline.cpp index 9de676181..f7bfc74fb 100644 --- a/src/shell/Readline.cpp +++ b/src/shell/Readline.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,10 +25,10 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include -#include #include #ifdef HAVE_READLINE diff --git a/src/shell/Readline.h b/src/shell/Readline.h index 9d5bf8b78..655afdfb7 100644 --- a/src/shell/Readline.h +++ b/src/shell/Readline.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/src/shell/main.cpp b/src/shell/main.cpp index b3b73eeba..fc1b98c95 100644 --- a/src/shell/main.cpp +++ b/src/shell/main.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,17 +25,12 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include #include -#ifdef CYGWIN -#include -#else -#include -#endif - #include #include #include @@ -44,22 +39,9 @@ Context context; -#ifdef HAVE_SRANDOM -#define srand(x) srandom(x) -#endif - //////////////////////////////////////////////////////////////////////////////// int main (int argc, const char** argv) { - // Set up randomness. -#ifdef CYGWIN - srand (time (NULL)); -#else - struct timeval tv; - gettimeofday (&tv, NULL); - srand (tv.tv_usec); -#endif - bool read_from_file = false; if (argc > 2) @@ -94,27 +76,34 @@ int main (int argc, const char** argv) } } - // if a file is given, read from it + // If a file is given, read from it std::ifstream fin; if (read_from_file) { fin.open (argv[1]); } - // commands may be redirected too + // Commands may be redirected too std::istream &in = read_from_file ? fin : std::cin; - // Begining initilaization - context.initialize (0, NULL); + if (Readline::interactiveMode (in)) + { + // Begining initilaization + if (context.initialize (0, NULL)) + { + return -1; + } - // Display some kind of welcome message. - Color bold (Color::nocolor, Color::nocolor, false, true, false); + // Display some kind of welcome message. + Color bold (Color::nocolor, Color::nocolor, false, true, false); - std::cout << (context.color () ? bold.colorize (PACKAGE_STRING) : PACKAGE_STRING) - << " shell\n\n" - << STRING_CMD_SHELL_HELP1 << '\n' - << STRING_CMD_SHELL_HELP2 << '\n' - << STRING_CMD_SHELL_HELP3 << "\n\n"; + std::cout << (context.color () ? bold.colorize (PACKAGE_STRING) + : PACKAGE_STRING) + << " shell\n\n" + << STRING_CMD_SHELL_HELP1 << '\n' + << STRING_CMD_SHELL_HELP2 << '\n' + << STRING_CMD_SHELL_HELP3 << "\n\n"; + } // Make a copy because context.clear will delete them. std::string permanent_overrides; diff --git a/src/sort.cpp b/src/sort.cpp index 51ae312d3..e227cc0e7 100644 --- a/src/sort.cpp +++ b/src/sort.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/text.cpp b/src/text.cpp index 5143ebe03..13ceb265c 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include diff --git a/src/text.h b/src/text.h index 5b98b60bc..3d78d031c 100644 --- a/src/text.h +++ b/src/text.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -30,7 +30,6 @@ #include #include -#include // text.cpp, Non-UTF-8 aware. void wrapText (std::vector &, const std::string&, const int, bool); diff --git a/src/util.cpp b/src/util.cpp index 22540c358..89a8892c7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,7 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include #include @@ -50,7 +51,6 @@ #include #include #include -#include extern Context context; @@ -229,9 +229,29 @@ int autoComplete ( return matches.size (); } -//////////////////////////////////////////////////////////////////////////////// -#ifdef HAVE_UUID +// Handle the generation of UUIDs on FreeBSD in a separate implementation +// of the uuid () function, since the API is quite different from Linux's. +// Also, uuid_unparse_lower is not needed on FreeBSD, because the string +// representation is always lowercase anyway. +// For the implementation details, refer to +// http://svnweb.freebsd.org/base/head/sys/kern/kern_uuid.c +#ifdef FREEBSD +const std::string uuid () +{ + uuid_t id; + uint32_t status; + char *buffer (0); + uuid_create (&id, &status); + uuid_to_string (&id, &buffer, &status); + std::string res (buffer); + free (buffer); + + return res; +} +#else + +//////////////////////////////////////////////////////////////////////////////// #ifndef HAVE_UUID_UNPARSE_LOWER // Older versions of libuuid don't have uuid_unparse_lower(), only uuid_unparse() void uuid_unparse_lower (uuid_t uu, char *out) @@ -255,32 +275,6 @@ const std::string uuid () return std::string (buffer); } - -//////////////////////////////////////////////////////////////////////////////// -#else - -#ifdef HAVE_RANDOM -#define rand() random() -#endif - -//////////////////////////////////////////////////////////////////////////////// -const std::string uuid () -{ - uint32_t time_low = ((rand () << 16) & 0xffff0000) | (rand () & 0xffff); - uint16_t time_mid = rand () & 0xffff; - uint16_t time_high_and_version = (rand () & 0x0fff) | 0x4000; - uint16_t clock_seq = (rand () & 0x3fff) | 0x8000; - uint8_t node [6]; - for (size_t i = 0; i < 6; i++) - node[i] = rand() & 0xff; - - char buffer[37]; - sprintf(buffer, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - time_low, time_mid, time_high_and_version, clock_seq >> 8, clock_seq & 0xff, - node[0], node[1], node[2], node[3], node[4], node[5]); - - return std::string (buffer); -} #endif //////////////////////////////////////////////////////////////////////////////// diff --git a/src/util.h b/src/util.h index db6f5ee9b..da6acfa72 100644 --- a/src/util.h +++ b/src/util.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -28,16 +28,17 @@ #ifndef INCLUDED_UTIL #define INCLUDED_UTIL +#include #include #include #include #include -#include -#include - -#ifdef HAVE_UUID +#ifdef FREEBSD +#include +#else #include #endif +#include // util.cpp bool confirm (const std::string&); @@ -47,7 +48,7 @@ void delay (float); std::string formatBytes (size_t); int autoComplete (const std::string&, const std::vector&, std::vector&, int minimum = 1); -#if defined(HAVE_UUID) && !defined(HAVE_UUID_UNPARSE_LOWER) +#ifndef HAVE_UUID_UNPARSE_LOWER void uuid_unparse_lower (uuid_t uu, char *out); #endif const std::string uuid (); diff --git a/test/.gitignore b/test/.gitignore index 51e74ca4a..da527b999 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -25,6 +25,7 @@ path.t rx.t t.t t2.t +t3.t taskmod.t tdb2.t text.t diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3948d6b49..507466820 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -8,7 +8,7 @@ include_directories (${CMAKE_SOURCE_DIR} set (test_SRCS autocomplete.t color.t config.t date.t directory.t dom.t old_duration.t file.t i18n.t json.t list.t msg.t nibbler.t path.t - rx.t t.t t2.t taskmod.t tdb2.t text.t tree.t uri.t utf8.t util.t + rx.t t.t t2.t t3.t taskmod.t tdb2.t text.t tree.t uri.t utf8.t util.t view.t width.t json_test iso8601d.t iso8601p.t duration.t lexer.t variant_add.t variant_and.t variant_cast.t variant_divide.t variant_equal.t variant_exp.t variant_gt.t variant_gte.t @@ -37,8 +37,8 @@ endif (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) configure_file (run_all.in run_all) add_custom_target (test ./run_all --verbose - DEPENDS ${test_SRCS} task_executable - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test) + DEPENDS ${test_SRCS} task_executable + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test) add_custom_target (build_tests DEPENDS ${test_SRCS} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/test) diff --git a/test/TAP.py b/test/TAP.py index 32c6a8faa..06d4b77b9 100644 --- a/test/TAP.py +++ b/test/TAP.py @@ -1,7 +1,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/test/abbreviation.t b/test/abbreviation.t index de7243046..7b1bc167f 100755 --- a/test/abbreviation.t +++ b/test/abbreviation.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 21; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'abbrev.rc') { diff --git a/test/add.t b/test/add.t index c7d022f75..932eee431 100755 --- a/test/add.t +++ b/test/add.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 9; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'add.rc') { diff --git a/test/alias.t b/test/alias.t index 9020c9349..c639d7ed8 100755 --- a/test/alias.t +++ b/test/alias.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'alias.rc') { diff --git a/test/annotate.t b/test/annotate.t index 5985bcdff..6cd57f20c 100755 --- a/test/annotate.t +++ b/test/annotate.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 25; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'annotate.rc') { diff --git a/test/append.t b/test/append.t index da562bbd1..a6f6def57 100755 --- a/test/append.t +++ b/test/append.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'append.rc') { diff --git a/test/args.1.t b/test/args.1.t index 585fee41c..41bf6c4a2 100755 --- a/test/args.1.t +++ b/test/args.1.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'args.rc') { diff --git a/test/args.2.t b/test/args.2.t index 9f1f1ee25..cbeafe084 100755 --- a/test/args.2.t +++ b/test/args.2.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'args.rc') { diff --git a/test/args.3.t b/test/args.3.t index 1dae5ee93..0ec77c07f 100755 --- a/test/args.3.t +++ b/test/args.3.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'args.rc') { diff --git a/test/args.4.t b/test/args.4.t index 466e154e4..d7d9a2032 100755 --- a/test/args.4.t +++ b/test/args.4.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'args.rc') { diff --git a/test/args.5.t b/test/args.5.t index 79835d658..29950cbb0 100755 --- a/test/args.5.t +++ b/test/args.5.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'args.rc') { diff --git a/test/args.t b/test/args.t index a06029291..df2aef4c7 100755 --- a/test/args.t +++ b/test/args.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'args.rc') { diff --git a/test/autocomplete.t.cpp b/test/autocomplete.t.cpp index 7168a1621..a2f7baab1 100644 --- a/test/autocomplete.t.cpp +++ b/test/autocomplete.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -37,6 +39,10 @@ int main (int argc, char** argv) { UnitTest t (8); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + std::vector options; options.push_back ("abc"); options.push_back ("abcd"); diff --git a/test/backslash.t b/test/backslash.t index ab586e87c..a249fb9c1 100755 --- a/test/backslash.t +++ b/test/backslash.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'backslash.rc') { diff --git a/test/bash_completion.t b/test/bash_completion.t index 2fa0a462a..0246760c7 100755 --- a/test/bash_completion.t +++ b/test/bash_completion.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 18; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/basic.t b/test/basic.t index 3c46924ba..e7ebc9850 100755 --- a/test/basic.t +++ b/test/basic.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'basic.rc') { diff --git a/test/bug.1006.t b/test/bug.1006.t index 6cdf26854..f1eaf6a00 100755 --- a/test/bug.1006.t +++ b/test/bug.1006.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1023.t b/test/bug.1023.t index aece0611c..fe8514228 100755 --- a/test/bug.1023.t +++ b/test/bug.1023.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 11; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1031.t b/test/bug.1031.t index 31235cd97..ee34ced25 100755 --- a/test/bug.1031.t +++ b/test/bug.1031.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1036.t b/test/bug.1036.t index 328a9d1d8..8145a2a36 100755 --- a/test/bug.1036.t +++ b/test/bug.1036.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1043.t b/test/bug.1043.t index 72776a33d..af7470071 100755 --- a/test/bug.1043.t +++ b/test/bug.1043.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1044.t b/test/bug.1044.t index a8716cbed..30e9092a7 100755 --- a/test/bug.1044.t +++ b/test/bug.1044.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1056.t b/test/bug.1056.t index 14b7fcdb8..4cd43de7b 100755 --- a/test/bug.1056.t +++ b/test/bug.1056.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 9; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.1056') { diff --git a/test/bug.1063.t b/test/bug.1063.t index 0547bb3f8..6fa5bd9dc 100755 --- a/test/bug.1063.t +++ b/test/bug.1063.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -31,6 +31,10 @@ use warnings; use Test::More tests => 8; use File::Basename; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + my $ut = basename ($0); my $rc = $ut . '.rc'; diff --git a/test/bug.1065.t b/test/bug.1065.t index 2194813ea..c30d23efb 100755 --- a/test/bug.1065.t +++ b/test/bug.1065.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 14; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1104.t b/test/bug.1104.t index 92e4e5270..02bc7b2a5 100755 --- a/test/bug.1104.t +++ b/test/bug.1104.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -32,6 +32,10 @@ use File::Copy; use File::Path; use Test::More tests => 33; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + mkdir("1", 0755); mkdir("2", 0755); mkdir("3", 0755); diff --git a/test/bug.1110.t b/test/bug.1110.t index 384eb9a9a..3b515e837 100755 --- a/test/bug.1110.t +++ b/test/bug.1110.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.1117.t b/test/bug.1117.t index 5db913d7a..d674ed958 100755 --- a/test/bug.1117.t +++ b/test/bug.1117.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -32,6 +32,10 @@ use File::Copy; use File::Path; use Test::More tests => 13; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + mkdir("1", 0755); mkdir("2", 0755); mkdir("merge", 0755); diff --git a/test/bug.1192.t b/test/bug.1192.t index 50d958168..443c3c84e 100755 --- a/test/bug.1192.t +++ b/test/bug.1192.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.299.t b/test/bug.299.t index 85b8d089a..f5e20b94f 100755 --- a/test/bug.299.t +++ b/test/bug.299.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.327.t b/test/bug.327.t index add46bcbb..62975557f 100755 --- a/test/bug.327.t +++ b/test/bug.327.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.360.t b/test/bug.360.t index 0199aae5e..8d5aa1b8e 100755 --- a/test/bug.360.t +++ b/test/bug.360.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.368.t b/test/bug.368.t index 503311dc2..8a2847f2a 100755 --- a/test/bug.368.t +++ b/test/bug.368.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.414.t b/test/bug.414.t index b9a1a8c20..1795eec0c 100755 --- a/test/bug.414.t +++ b/test/bug.414.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.417.t b/test/bug.417.t index 04139e097..4a52cd5c3 100755 --- a/test/bug.417.t +++ b/test/bug.417.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.418.t b/test/bug.418.t index ae0635e6a..a5018b1fb 100755 --- a/test/bug.418.t +++ b/test/bug.418.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 20; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.425.t b/test/bug.425.t index a560f251e..f32db6d6c 100755 --- a/test/bug.425.t +++ b/test/bug.425.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', '425.rc') { diff --git a/test/bug.434.t b/test/bug.434.t index 6955917f6..ce69bef91 100755 --- a/test/bug.434.t +++ b/test/bug.434.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.438.t b/test/bug.438.t index e9dd82b26..cabb70158 100755 --- a/test/bug.438.t +++ b/test/bug.438.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.440.t b/test/bug.440.t index 5688b7719..3acce940c 100755 --- a/test/bug.440.t +++ b/test/bug.440.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', '440.rc') { diff --git a/test/bug.441.t b/test/bug.441.t index c4f771801..5385eb709 100755 --- a/test/bug.441.t +++ b/test/bug.441.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', '441.rc') { diff --git a/test/bug.455.t b/test/bug.455.t index 6aa72bda3..30e2a7909 100755 --- a/test/bug.455.t +++ b/test/bug.455.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', '455.rc') { diff --git a/test/bug.480.t b/test/bug.480.t index a12942022..78991f923 100755 --- a/test/bug.480.t +++ b/test/bug.480.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 40; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.485.x b/test/bug.485.x index 38f419ba5..819fdbb72 100755 --- a/test/bug.485.x +++ b/test/bug.485.x @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/test/bug.489.t b/test/bug.489.t index 6a9c66ca6..4b5f06d6b 100755 --- a/test/bug.489.t +++ b/test/bug.489.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.495.t b/test/bug.495.t index 036aefb76..35f2d231f 100755 --- a/test/bug.495.t +++ b/test/bug.495.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.555.t b/test/bug.555.t index 1a7cda6c2..63a1c66d5 100755 --- a/test/bug.555.t +++ b/test/bug.555.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.580.t b/test/bug.580.t index 4b017b559..5a56adb80 100755 --- a/test/bug.580.t +++ b/test/bug.580.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -31,6 +31,10 @@ use warnings; use Test::More tests => 11; use File::Copy; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + use constant false => 0; use constant true => 1; diff --git a/test/bug.605.t b/test/bug.605.t index 8dea0d4ce..97490832d 100755 --- a/test/bug.605.t +++ b/test/bug.605.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.628.t b/test/bug.628.t index d15a4e6f5..abc8f2fba 100755 --- a/test/bug.628.t +++ b/test/bug.628.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.634.t b/test/bug.634.t index a76937558..26da9ced2 100755 --- a/test/bug.634.t +++ b/test/bug.634.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.635.t b/test/bug.635.t index ca2596325..92c577e2e 100755 --- a/test/bug.635.t +++ b/test/bug.635.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.649.t b/test/bug.649.t index df48a454a..c8906c588 100755 --- a/test/bug.649.t +++ b/test/bug.649.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.656.t b/test/bug.656.t index e733ca6f0..0a97153d4 100755 --- a/test/bug.656.t +++ b/test/bug.656.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.674.t b/test/bug.674.t index 53b87fde2..cf7b9a277 100755 --- a/test/bug.674.t +++ b/test/bug.674.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.694.t b/test/bug.694.t index 3f48644a8..b1fe76070 100755 --- a/test/bug.694.t +++ b/test/bug.694.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.697.x b/test/bug.697.x index 951e2bc16..8f2e084ea 100755 --- a/test/bug.697.x +++ b/test/bug.697.x @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/test/bug.703.t b/test/bug.703.t index 852bfcaa0..7da076b97 100755 --- a/test/bug.703.t +++ b/test/bug.703.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.708.t b/test/bug.708.t index ed3cda18a..6d4ed8b04 100755 --- a/test/bug.708.t +++ b/test/bug.708.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.804.t b/test/bug.804.t index 810bca65f..b77bf5bfb 100755 --- a/test/bug.804.t +++ b/test/bug.804.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.818.t b/test/bug.818.t index 8ceb676d6..af27ff678 100755 --- a/test/bug.818.t +++ b/test/bug.818.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.819.t b/test/bug.819.t index aaba00c45..d33dccba6 100755 --- a/test/bug.819.t +++ b/test/bug.819.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.835.t b/test/bug.835.t index 3491390ad..c113a4f0e 100755 --- a/test/bug.835.t +++ b/test/bug.835.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.837.t b/test/bug.837.t index a9315975d..475c67794 100755 --- a/test/bug.837.t +++ b/test/bug.837.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.839.t b/test/bug.839.t index 554e36a13..021374088 100755 --- a/test/bug.839.t +++ b/test/bug.839.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.851.t b/test/bug.851.t index c417ceb3f..c5c06c772 100755 --- a/test/bug.851.t +++ b/test/bug.851.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.856.t b/test/bug.856.t index faea54779..35975cd61 100755 --- a/test/bug.856.t +++ b/test/bug.856.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.860.t b/test/bug.860.t index b92bbdef1..1cc7b893e 100755 --- a/test/bug.860.t +++ b/test/bug.860.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.879.t b/test/bug.879.t index abf6477f9..dd9c7b6e8 100755 --- a/test/bug.879.t +++ b/test/bug.879.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.884.t b/test/bug.884.t index 9944bb03e..b18311d9c 100755 --- a/test/bug.884.t +++ b/test/bug.884.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.886.t b/test/bug.886.t index 8eda88468..96b26c7d3 100755 --- a/test/bug.886.t +++ b/test/bug.886.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.899.t b/test/bug.899.t index 9712d7997..e64428aea 100755 --- a/test/bug.899.t +++ b/test/bug.899.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.906.t b/test/bug.906.t index f77bbf8c1..64ab80826 100755 --- a/test/bug.906.t +++ b/test/bug.906.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 17; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.917.t b/test/bug.917.t index 990f2837e..5345de8ec 100755 --- a/test/bug.917.t +++ b/test/bug.917.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.924.t b/test/bug.924.t index b1849cbaf..80679d8b1 100755 --- a/test/bug.924.t +++ b/test/bug.924.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.932.t b/test/bug.932.t index b68ba593d..0a6f30152 100755 --- a/test/bug.932.t +++ b/test/bug.932.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 12; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.954.t b/test/bug.954.t index 4043a769d..92d6aa18f 100755 --- a/test/bug.954.t +++ b/test/bug.954.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.955.t b/test/bug.955.t index b7b466dfa..de000efc2 100755 --- a/test/bug.955.t +++ b/test/bug.955.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.956.t b/test/bug.956.t index 1962461fd..2fbb23736 100755 --- a/test/bug.956.t +++ b/test/bug.956.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 14; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.972.t b/test/bug.972.t index 78e980621..90dd52d6b 100755 --- a/test/bug.972.t +++ b/test/bug.972.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.982.x b/test/bug.982.x index c775339b5..be0569fda 100755 --- a/test/bug.982.x +++ b/test/bug.982.x @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/test/bug.986.t b/test/bug.986.t index 046d6580d..0c80954d8 100755 --- a/test/bug.986.t +++ b/test/bug.986.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.987.x b/test/bug.987.x index 0d7856328..2d442eb5f 100755 --- a/test/bug.987.x +++ b/test/bug.987.x @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 diff --git a/test/bug.990.t b/test/bug.990.t index 489ce8a0f..83f80fb4c 100755 --- a/test/bug.990.t +++ b/test/bug.990.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/bug.991.t b/test/bug.991.t index 6ff07c35a..aa2c2588a 100755 --- a/test/bug.991.t +++ b/test/bug.991.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.annotate.t b/test/bug.annotate.t index 41a9d046d..d8540d81f 100755 --- a/test/bug.annotate.t +++ b/test/bug.annotate.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.annual.t b/test/bug.annual.t index feb23f007..231431c0e 100755 --- a/test/bug.annual.t +++ b/test/bug.annual.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 13; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'annual.rc') { diff --git a/test/bug.before.t b/test/bug.before.t index 94ccaf498..0e98d273d 100755 --- a/test/bug.before.t +++ b/test/bug.before.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -31,6 +31,10 @@ use warnings; use Time::Local; use Test::More tests => 17; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'before.rc') { diff --git a/test/bug.bulk.t b/test/bug.bulk.t index 93023606b..8a76ccd9f 100755 --- a/test/bug.bulk.t +++ b/test/bug.bulk.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 12; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bulk.rc') { diff --git a/test/bug.c001.t b/test/bug.c001.t index cc1a4c853..c1cfb281c 100755 --- a/test/bug.c001.t +++ b/test/bug.c001.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.cal.t b/test/bug.cal.t index c27155a1d..906650816 100755 --- a/test/bug.cal.t +++ b/test/bug.cal.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 29; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'cal.rc') { diff --git a/test/bug.concat.t b/test/bug.concat.t index 128a72c68..68706beb2 100755 --- a/test/bug.concat.t +++ b/test/bug.concat.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/bug.hang.t b/test/bug.hang.t index cf9b2e5e4..4099fb5e1 100755 --- a/test/bug.hang.t +++ b/test/bug.hang.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'hang.rc') { diff --git a/test/bug.hasnt.t b/test/bug.hasnt.t index 3a490a2e1..b7686f42e 100755 --- a/test/bug.hasnt.t +++ b/test/bug.hasnt.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 16; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'hasnt.rc') { diff --git a/test/bug.period.t b/test/bug.period.t index f80bcca02..128e91c6f 100755 --- a/test/bug.period.t +++ b/test/bug.period.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 41; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'period.rc') { diff --git a/test/bug.range.t b/test/bug.range.t index 94f5cc2f5..d5e46bf59 100755 --- a/test/bug.range.t +++ b/test/bug.range.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'range.rc') { diff --git a/test/bug.recur.t b/test/bug.recur.t index c136ff226..ba9049017 100755 --- a/test/bug.recur.t +++ b/test/bug.recur.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'recur.rc') { diff --git a/test/bug.sort.t b/test/bug.sort.t index d7b2cb017..d7e176feb 100755 --- a/test/bug.sort.t +++ b/test/bug.sort.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug_sort.rc') { diff --git a/test/bug.start.extra.t b/test/bug.start.extra.t index 162088107..5501778cf 100755 --- a/test/bug.start.extra.t +++ b/test/bug.start.extra.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'extra.rc') { diff --git a/test/bug.summary.t b/test/bug.summary.t index 4ab768f24..84ad04ff6 100755 --- a/test/bug.summary.t +++ b/test/bug.summary.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'summary.rc') { diff --git a/test/bug.uuid.t b/test/bug.uuid.t index 9a79e900b..79692e3ee 100755 --- a/test/bug.uuid.t +++ b/test/bug.uuid.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uuid.rc') { diff --git a/test/bulk.t b/test/bulk.t index 2b92871a6..5c8e2a228 100755 --- a/test/bulk.t +++ b/test/bulk.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 44; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bulk.rc') { diff --git a/test/cal.t b/test/cal.t index c1f30bb23..54f867fe9 100755 --- a/test/cal.t +++ b/test/cal.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -32,6 +32,10 @@ use strict; use warnings; use Test::More tests => 84; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'cal.rc') { diff --git a/test/caseless.t b/test/caseless.t index 0ea06a3a0..b08cd9145 100755 --- a/test/caseless.t +++ b/test/caseless.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 18; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'caseless.rc') { diff --git a/test/color.active.t b/test/color.active.t index 75d9ca60d..885814610 100755 --- a/test/color.active.t +++ b/test/color.active.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.blocked.t b/test/color.blocked.t index af9865a2c..fadf07992 100755 --- a/test/color.blocked.t +++ b/test/color.blocked.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.deprecated.t b/test/color.deprecated.t index 410957c73..36adaf7d4 100755 --- a/test/color.deprecated.t +++ b/test/color.deprecated.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.disable.t b/test/color.disable.t index 24295b436..76f1fc140 100755 --- a/test/color.disable.t +++ b/test/color.disable.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.due.t b/test/color.due.t index 4e2938b71..425c37756 100755 --- a/test/color.due.t +++ b/test/color.due.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.duetoday.t b/test/color.duetoday.t index dbe66ddfd..990a4b7bc 100755 --- a/test/color.duetoday.t +++ b/test/color.duetoday.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.err.t b/test/color.err.t index f1224c9ec..54dfd07ce 100755 --- a/test/color.err.t +++ b/test/color.err.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { @@ -46,8 +50,8 @@ if (open my $fh, '>', 'color.rc') # Test the errors colors my $output = qx{../src/task rc:color.rc rc.debug:on add due:__ 2>&1 >/dev/null}; like ($output, qr/^\033\[33mThe\ duration\ '__'\ was\ not\ recognized\ as\ valid,\ with\ correct\ units\ like\ '3days'\.\033\[0m$/xms, 'color.error'); -like ($output, qr/^\033\[32mTimer\ Config::load\ \(color.rc\) .* \033\[0m$/xms, 'color.debug'); -like ($output, qr/^\033\[34mUsing\ alternate\ .taskrc\ file\ color.rc\033\[0m$/xms, 'color.header'); +like ($output, qr/^\033\[32mTimer\ Config::load\ \(.+color.rc\) .* \033\[0m$/xms, 'color.debug'); +like ($output, qr/^\033\[34mUsing\ alternate\ .taskrc\ file\ /xms, 'color.header'); like ($output, qr/^\033\[31mConfiguration\ override\ rc.debug:on\033\[0m$/xms, 'color.footnote'); # Cleanup. diff --git a/test/color.keyword.t b/test/color.keyword.t index 40606312e..21f1e5fe5 100755 --- a/test/color.keyword.t +++ b/test/color.keyword.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.overdue.t b/test/color.overdue.t index fc64a821a..77d99b844 100755 --- a/test/color.overdue.t +++ b/test/color.overdue.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.pri.t b/test/color.pri.t index ff49403da..8fedbc9fb 100755 --- a/test/color.pri.t +++ b/test/color.pri.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.project.t b/test/color.project.t index a9369deda..5e4948362 100755 --- a/test/color.project.t +++ b/test/color.project.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.recurring.t b/test/color.recurring.t index 494e5cd66..a3770a275 100755 --- a/test/color.recurring.t +++ b/test/color.recurring.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.t.cpp b/test/color.t.cpp index 209583599..1bbbadc78 100644 --- a/test/color.t.cpp +++ b/test/color.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -37,6 +39,10 @@ int main (int argc, char** argv) { UnitTest t (1036); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + // Names matched to values. t.is ((int) Color (""), (int) Color (Color::nocolor), "'' == Color::nocolor"); t.is ((int) Color ("black"), (int) Color (Color::black), "'black' == Color::black"); diff --git a/test/color.tag.t b/test/color.tag.t index 75f1a799d..0ab670598 100755 --- a/test/color.tag.t +++ b/test/color.tag.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.tagged.t b/test/color.tagged.t index a5dc76e7a..2863f7da4 100755 --- a/test/color.tagged.t +++ b/test/color.tagged.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -29,10 +29,14 @@ use strict; use warnings; use Test::More tests => 5; + +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + unlink 'pending.data'; ok (!-r 'pending.data', 'Removed pending.data'); - # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/color.uda.t b/test/color.uda.t index 770abe0a3..42683e055 100755 --- a/test/color.uda.t +++ b/test/color.uda.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'color.rc') { diff --git a/test/completed.t b/test/completed.t index 97d62b06a..2fe42bd99 100755 --- a/test/completed.t +++ b/test/completed.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'completed.rc') { diff --git a/test/config.obsolete.t b/test/config.obsolete.t index 497b07d0d..fca1f6eb0 100755 --- a/test/config.obsolete.t +++ b/test/config.obsolete.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'obsolete.rc') { diff --git a/test/config.t.cpp b/test/config.t.cpp index 5615e2613..7a8ba29b5 100644 --- a/test/config.t.cpp +++ b/test/config.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006 - 2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006 - 2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include @@ -36,6 +38,10 @@ int main (int argc, char** argv) { UnitTest t (11); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + Config c; // void set (const std::string&, const std::string&); diff --git a/test/confirmation.t b/test/confirmation.t index 9bcce4674..e6f8c724f 100755 --- a/test/confirmation.t +++ b/test/confirmation.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 24; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'confirm.rc') { diff --git a/test/count.t b/test/count.t index dd3111d30..8949b9de1 100755 --- a/test/count.t +++ b/test/count.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'count.rc') { diff --git a/test/countdown.t b/test/countdown.t index 5354c19a3..c0e1e1a1e 100755 --- a/test/countdown.t +++ b/test/countdown.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 82; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'countdown.rc') { diff --git a/test/custom.columns.t b/test/custom.columns.t index 141ac4f64..42376b05b 100755 --- a/test/custom.columns.t +++ b/test/custom.columns.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'custom.rc') { diff --git a/test/custom.priority_long.t b/test/custom.priority_long.t index 456036a5f..a655ba8e0 100755 --- a/test/custom.priority_long.t +++ b/test/custom.priority_long.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'pri.rc') { diff --git a/test/custom.recur_ind.t b/test/custom.recur_ind.t index 2dfd16fe1..a14674f8c 100755 --- a/test/custom.recur_ind.t +++ b/test/custom.recur_ind.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'custom.rc') { diff --git a/test/custom.t b/test/custom.t index 905040eb7..9318602d4 100755 --- a/test/custom.t +++ b/test/custom.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'custom.rc') { diff --git a/test/custom.tag_ind.t b/test/custom.tag_ind.t index 876da8003..8e68462fa 100755 --- a/test/custom.tag_ind.t +++ b/test/custom.tag_ind.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'custom.rc') { diff --git a/test/date.iso.t b/test/date.iso.t index cb9b585bb..3500cc931 100755 --- a/test/date.iso.t +++ b/test/date.iso.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'iso.rc') { diff --git a/test/date.t.cpp b/test/date.t.cpp index 618fa750e..c57a535a4 100644 --- a/test/date.t.cpp +++ b/test/date.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -35,7 +37,11 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (205); + UnitTest t (209); + + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); try { @@ -60,9 +66,11 @@ int main (int argc, char** argv) t.ok (now < tomorrow, "now < tomorrow"); // Date::Date ("now") + context.config.set ("weekstart", "monday"); Date relative_now ("now"); t.ok (relative_now.sameHour (now), "Date ().sameHour (Date (now))"); t.ok (relative_now.sameDay (now), "Date ().sameDay (Date (now))"); + t.ok (relative_now.sameWeek (now), "Date ().sameWeek (Date (now))"); t.ok (relative_now.sameMonth (now), "Date ().sameMonth (Date (now))"); t.ok (relative_now.sameYear (now), "Date ().sameYear (Date (now))"); @@ -70,6 +78,7 @@ int main (int argc, char** argv) Date left ("7/4/2008"); Date comp1 ("7/4/2008"); t.ok (left.sameDay (comp1), "7/4/2008 is on the same day as 7/4/2008"); + t.ok (left.sameWeek (comp1), "7/4/2008 is on the same week as 7/4/2008"); t.ok (left.sameMonth (comp1), "7/4/2008 is in the same month as 7/4/2008"); t.ok (left.sameYear (comp1), "7/4/2008 is in the same year as 7/4/2008"); @@ -80,11 +89,13 @@ int main (int argc, char** argv) Date comp3 ("8/4/2008"); t.notok (left.sameDay (comp3), "7/4/2008 is not on the same day as 8/4/2008"); + t.notok (left.sameWeek (comp3), "7/4/2008 is not on the same week as 8/4/2008"); t.notok (left.sameMonth (comp3), "7/4/2008 is not in the same month as 8/4/2008"); t.ok (left.sameYear (comp3), "7/4/2008 is in the same year as 8/4/2008"); Date comp4 ("7/4/2009"); t.notok (left.sameDay (comp4), "7/4/2008 is not on the same day as 7/4/2009"); + t.notok (left.sameWeek (comp3), "7/4/2008 is not on the same week as 7/4/2009"); t.notok (left.sameMonth (comp4), "7/4/2008 is not in the same month as 7/4/2009"); t.notok (left.sameYear (comp4), "7/4/2008 is not in the same year as 7/4/2009"); @@ -326,7 +337,7 @@ int main (int argc, char** argv) t.ok (r11 < now + (8 * 86400), "eow < 7 days away"); Date r12 ("eocw"); - t.ok (r12 < now + (8 * 86400), "eocw < 7 days away"); + t.ok (r12 > now - (8 * 86400), "eocw < 7 days in the past"); Date r13 ("eom"); t.ok (r13.sameMonth (now), "eom in same month as now"); @@ -341,7 +352,7 @@ int main (int argc, char** argv) t.ok (r16 < now + (8 * 86400), "sow < 7 days away"); Date r23 ("socw"); - t.ok (r23 < now + (8 * 86400), "sow < 7 days away"); + t.ok (r23 > now - (8 * 86400), "sow < 7 days in the past"); Date r17 ("som"); t.notok (r17.sameMonth (now), "som not in same month as now"); diff --git a/test/dateformat.t b/test/dateformat.t index bfea1d04b..bfdda377e 100755 --- a/test/dateformat.t +++ b/test/dateformat.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'date1.rc') { diff --git a/test/datesort.t b/test/datesort.t index e366b40da..cf1331ba6 100755 --- a/test/datesort.t +++ b/test/datesort.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'datesort.rc') { diff --git a/test/default.t b/test/default.t index 2b1781b37..07195782c 100755 --- a/test/default.t +++ b/test/default.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 21; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'default.rc') { diff --git a/test/delete.t b/test/delete.t index 5450902ae..21fc51c1a 100755 --- a/test/delete.t +++ b/test/delete.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 16; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'delete.rc') { @@ -48,7 +52,7 @@ $output = qx{../src/task rc:delete.rc 1 delete 2>&1; ../src/task rc:delete.rc in like ($output, qr/Status\s+Deleted\n/, 'Deleted'); ok (-r 'completed.data', 'completed.data created'); -$output = qx{echo 'y' | ../src/task rc:delete.rc undo 2>&1; ../src/task rc:delete.rc info 1 2>&1}; +$output = qx{../src/task rc:delete.rc undo 2>&1; ../src/task rc:delete.rc info 1 2>&1}; like ($output, qr/Status\s+Pending\n/, 'Pending'); ok (-r 'completed.data', 'completed.data created'); diff --git a/test/denotate.t b/test/denotate.t index 68ebb19d8..87ce217bc 100755 --- a/test/denotate.t +++ b/test/denotate.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 27; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'denotate.rc') { diff --git a/test/dependencies.t b/test/dependencies.t index a608ebb2d..6c98da2bf 100755 --- a/test/dependencies.t +++ b/test/dependencies.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 49; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'dep.rc') { diff --git a/test/directory.t.cpp b/test/directory.t.cpp index 444272268..dd1f961ce 100644 --- a/test/directory.t.cpp +++ b/test/directory.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -34,7 +36,11 @@ Context context; int main (int argc, char** argv) { - UnitTest t (37); + UnitTest t (49); + + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); Directory tmp ("tmp"); tmp.create (); @@ -51,17 +57,17 @@ int main (int argc, char** argv) // Directory (const Directory&); Directory d3 (d2); - t.is (d3._data, "tmp", "Directory (Directory&)"); + t.is (d3._data, Directory::cwd () + "/tmp", "Directory (Directory&)"); // Directory (const std::string&); Directory d4 ("tmp/test_directory"); // Directory& operator= (const Directory&); Directory d5 = d4; - t.is (d5._data, "tmp/test_directory", "Directory::operator="); + t.is (d5._data, Directory::cwd () + "/tmp/test_directory", "Directory::operator="); // operator (std::string) const; - t.is ((std::string) d3, "tmp", "Directory::operator (std::string) const"); + t.is ((std::string) d3, Directory::cwd () + "/tmp", "Directory::operator (std::string) const"); // virtual bool create (); t.ok (d5.create (), "Directory::create tmp/test_directory"); @@ -77,15 +83,15 @@ int main (int argc, char** argv) std::vector files = d5.list (); std::sort (files.begin (), files.end ()); t.is ((int)files.size (), 2, "Directory::list 1 file"); - t.is (files[0], "tmp/test_directory/dir", "file[0] is tmp/test_directory/dir"); - t.is (files[1], "tmp/test_directory/f0", "file[1] is tmp/test_directory/f0"); + t.is (files[0], Directory::cwd () + "/tmp/test_directory/dir", "file[0] is tmp/test_directory/dir"); + t.is (files[1], Directory::cwd () + "/tmp/test_directory/f0", "file[1] is tmp/test_directory/f0"); // std::vector listRecursive (); files = d5.listRecursive (); std::sort (files.begin (), files.end ()); t.is ((int)files.size (), 2, "Directory::list 1 file"); - t.is (files[0], "tmp/test_directory/dir/f1", "file is tmp/test_directory/dir/f1"); - t.is (files[1], "tmp/test_directory/f0", "file is tmp/test_directory/f0"); + t.is (files[0], Directory::cwd () + "/tmp/test_directory/dir/f1", "file is tmp/test_directory/dir/f1"); + t.is (files[1], Directory::cwd () + "/tmp/test_directory/f0", "file is tmp/test_directory/f0"); // virtual bool remove (); t.ok (File::remove (d5._data + "/f0"), "File::remove tmp/test_directory/f0"); @@ -123,6 +129,25 @@ int main (int argc, char** argv) t.is (d9._data, "/", "parent /one --> /"); t.notok (d9.up (), "parent / --> false"); + // Test permissions. + umask(0022); + Directory d10 ("tmp/dir.perm"); + d10.create (0750); + t.ok (d10.exists (), "Directory::create perm file exists"); + mode_t m = d10.mode (); + t.ok (m & S_IFDIR, "Directory::mode tmp/dir.perm S_IFDIR good"); + t.ok (m & S_IRUSR, "Directory::mode tmp/dir.perm r-------- good"); + t.ok (m & S_IWUSR, "Directory::mode tmp/dir.perm -w------- good"); + t.ok (m & S_IXUSR, "Directory::mode tmp/dir.perm --x------ good"); + t.ok (m & S_IRGRP, "Directory::mode tmp/dir.perm ---r----- good"); + t.notok (m & S_IWGRP, "Directory::mode tmp/dir.perm ----w---- good"); + t.ok (m & S_IXGRP, "Directory::mode tmp/dir.perm -----x--- good"); + t.notok (m & S_IROTH, "Directory::mode tmp/dir.perm ------r-- good"); + t.notok (m & S_IWOTH, "Directory::mode tmp/dir.perm -------w- good"); + t.notok (m & S_IXOTH, "Directory::mode tmp/dir.perm --------x good"); + d10.remove (); + t.notok (d10.exists (), "Directory::remove temp/dir.perm file no longer exists"); + tmp.remove (); t.notok (tmp.exists (), "tmp dir removed."); diff --git a/test/dom.2.t b/test/dom.2.t index e80db51d6..d4599c9b6 100755 --- a/test/dom.2.t +++ b/test/dom.2.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'dom.rc') { diff --git a/test/dom.t.cpp b/test/dom.t.cpp index 9f55b3a87..51b623578 100644 --- a/test/dom.t.cpp +++ b/test/dom.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,9 +25,10 @@ // //////////////////////////////////////////////////////////////////////////////// -#include -#include #include +#include +#include +#include #include #include @@ -38,19 +39,25 @@ int main (int argc, char** argv) { UnitTest t (6); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + try { // Prime the pump. context.a3.capture ("task"); - // TODO dom.get rc.name DOM dom; t.is (dom.get ("system.version"), VERSION, "DOM system.version -> VERSION"); t.ok (dom.get ("system.os") != "", "DOM system.os -> != Unknown"); t.is (dom.get ("context.program"), "task", "DOM context.program -> 'task'"); t.is (dom.get ("context.args"), "task", "DOM context.args -> 'task'"); - t.is (dom.get ("context.width"), "0", "DOM context.width -> '0'"); - t.is (dom.get ("context.height"), "0", "DOM context.height -> '0'"); + t.ok (dom.get ("context.width") != "0", "DOM context.width -> '0'"); + t.ok (dom.get ("context.height") != "0", "DOM context.height -> '0'"); + + // TODO dom.get rc.name +// t.is (dom.get ("rc.verbose"), "yes", "DOM rc.verbose -> 'yes'"); // TODO dom.set rc.name } diff --git a/test/due.t b/test/due.t index 21108bac3..f0ba0b4ee 100755 --- a/test/due.t +++ b/test/due.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'due.rc') { diff --git a/test/duplicate.t b/test/duplicate.t index 71e6944b5..8b6472866 100755 --- a/test/duplicate.t +++ b/test/duplicate.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 12; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'dup.rc') { diff --git a/test/duplicate2.t b/test/duplicate2.t index c8a6193ee..7fec55feb 100755 --- a/test/duplicate2.t +++ b/test/duplicate2.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 14; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'dup.rc') { diff --git a/test/duration.t.cpp b/test/duration.t.cpp index 6071eb565..a9b544dc3 100644 --- a/test/duration.t.cpp +++ b/test/duration.t.cpp @@ -25,6 +25,10 @@ //////////////////////////////////////////////////////////////////////////////// #include +#include +#include +#include +#include #include #include #include diff --git a/test/enpassant.t b/test/enpassant.t index dc6959f78..c6919b989 100755 --- a/test/enpassant.t +++ b/test/enpassant.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'enp.rc') { diff --git a/test/export.yaml.t b/test/export.yaml.t index 9d307f96a..c4e3539f8 100755 --- a/test/export.yaml.t +++ b/test/export.yaml.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 22; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + my $source_dir = $0; $source_dir =~ s{[^/]+$}{..}; diff --git a/test/feature.1013.t b/test/feature.1013.t index 178368ade..b1c9423af 100755 --- a/test/feature.1013.t +++ b/test/feature.1013.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'outerr.rc') { @@ -49,9 +53,9 @@ like ($stderr, qr/^The duration '__' was not recognized as valid, with correct u # Check that headers are sent to standard error $stdout = qx{../src/task rc:outerr.rc list 2> /dev/null}; -unlike ($stdout, qr/^Using alternate .taskrc file outerr.rc$/ms, 'Headers are not sent to stdout'); +unlike ($stdout, qr/^Using alternate .taskrc file .+outerr.rc$/ms, 'Headers are not sent to stdout'); $stderr = qx{../src/task rc:outerr.rc list 2>&1 >/dev/null}; -like ($stderr, qr/^Using alternate .taskrc file outerr.rc$/ms, 'Headers are sent to stderr'); +like ($stderr, qr/^Using alternate .taskrc file .+outerr.rc$/ms, 'Headers are sent to stderr'); # Check that footnotes are sent to standard error $stdout = qx{../src/task rc:outerr.rc rc.debug:on list 2> /dev/null}; @@ -61,9 +65,9 @@ like ($stderr, qr/^Configuration override rc.debug:on$/ms, 'Footnotes are sent t # Check that debugs are sent to standard error $stdout = qx{../src/task rc:outerr.rc rc.debug:on list 2> /dev/null}; -unlike ($stdout, qr/^Timer Config::load \(outerr.rc\) /ms, 'Debugs are not sent to stdout'); +unlike ($stdout, qr/^Timer Config::load \(.+outerr.rc\) /ms, 'Debugs are not sent to stdout'); $stderr = qx{../src/task rc:outerr.rc rc.debug:on list 2>&1 >/dev/null}; -like ($stderr, qr/^Timer Config::load \(outerr.rc\) /ms, 'Debugs are sent to stderr'); +like ($stderr, qr/^Timer Config::load \(.+outerr.rc\) /ms, 'Debugs are sent to stderr'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data outerr.rc); diff --git a/test/feature.1061.t b/test/feature.1061.t index ef472eb92..510d6d4bb 100755 --- a/test/feature.1061.t +++ b/test/feature.1061.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/feature.559.t b/test/feature.559.t index 8b287c9a5..d1797b36a 100755 --- a/test/feature.559.t +++ b/test/feature.559.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/feature.608.t b/test/feature.608.t index 490c1f3da..efffc83c2 100755 --- a/test/feature.608.t +++ b/test/feature.608.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/feature.632.t b/test/feature.632.t index 2d5715378..ab26ceb84 100755 --- a/test/feature.632.t +++ b/test/feature.632.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -31,6 +31,10 @@ use warnings; use Test::More tests => 12; use File::Path; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc files. if (open my $fh, '>', 'rc1') { diff --git a/test/feature.725.t b/test/feature.725.t index e0d063d1b..9be37fb37 100755 --- a/test/feature.725.t +++ b/test/feature.725.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'feature.rc') { diff --git a/test/feature.891.t b/test/feature.891.t index cbe726df6..e6d82f4f8 100755 --- a/test/feature.891.t +++ b/test/feature.891.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -31,6 +31,10 @@ use warnings; use Time::Local; use Test::More tests => 37; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/feature.exit.t b/test/feature.exit.t index 640d85762..74c05ff2a 100755 --- a/test/feature.exit.t +++ b/test/feature.exit.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'exit.rc') { diff --git a/test/feature.print.empty.columns.t b/test/feature.print.empty.columns.t index 5c382e0fa..6c7a40c19 100755 --- a/test/feature.print.empty.columns.t +++ b/test/feature.print.empty.columns.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/file.t.cpp b/test/file.t.cpp index 4bddc2df4..b5c63cfd5 100644 --- a/test/file.t.cpp +++ b/test/file.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,8 @@ // //////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include #include @@ -34,7 +36,11 @@ Context context; int main (int argc, char** argv) { - UnitTest t (15); + UnitTest t (27); + + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); Directory tmp ("tmp"); tmp.create (); @@ -47,7 +53,7 @@ int main (int argc, char** argv) t.ok (File::remove ("tmp/file.t.txt"), "File::remove tmp/file.t.txt good"); // operator (std::string) const; - t.is ((std::string) f6, "tmp/file.t.txt", "File::operator (std::string) const"); + t.is ((std::string) f6, Directory::cwd () + "/tmp/file.t.txt", "File::operator (std::string) const"); t.ok (File::create ("tmp/file.t.create"), "File::create tmp/file.t.create good"); t.ok (File::remove ("tmp/file.t.create"), "File::remove tmp/file.t.create good"); @@ -56,7 +62,7 @@ int main (int argc, char** argv) t.is (f6.name (), "file.t.txt", "File::basename tmp/file.t.txt --> file.t.txt"); // dirname (std::string) const; - t.is (f6.parent (), "tmp", "File::dirname tmp/file.t.txt --> /tmp"); + t.is (f6.parent (), Directory::cwd () + "/tmp", "File::dirname tmp/file.t.txt --> tmp"); // bool rename (const std::string&); File f7 ("tmp/file.t.2.txt"); @@ -64,11 +70,29 @@ int main (int argc, char** argv) f7.close (); t.ok (f7.rename ("tmp/file.t.3.txt"), "File::rename did not fail"); - t.is (f7._data, "tmp/file.t.3.txt", "File::rename stored new name"); + t.is (f7._data, Directory::cwd () + "/tmp/file.t.3.txt", "File::rename stored new name"); t.ok (f7.exists (), "File::rename new file exists"); t.ok (f7.remove (), "File::remove tmp/file.t.3.txt good"); t.notok (f7.exists (), "File::remove new file no longer exists"); + // Test permissions. + File f8 ("tmp/file.t.perm.txt"); + f8.create (0744); + t.ok (f8.exists (), "File::create perm file exists"); + mode_t m = f8.mode (); + t.ok (m & S_IFREG, "File::mode tmp/file.t.perm.txt S_IFREG good"); + t.ok (m & S_IRUSR, "File::mode tmp/file.t.perm.txt r-------- good"); + t.ok (m & S_IWUSR, "File::mode tmp/file.t.perm.txt -w------- good"); + t.ok (m & S_IXUSR, "File::mode tmp/file.t.perm.txt --x------ good"); + t.ok (m & S_IRGRP, "File::mode tmp/file.t.perm.txt ---r----- good"); + t.notok (m & S_IWGRP, "File::mode tmp/file.t.perm.txt ----w---- good"); + t.notok (m & S_IXGRP, "File::mode tmp/file.t.perm.txt -----x--- good"); + t.ok (m & S_IROTH, "File::mode tmp/file.t.perm.txt ------r-- good"); + t.notok (m & S_IWOTH, "File::mode tmp/file.t.perm.txt -------w- good"); + t.notok (m & S_IXOTH, "File::mode tmp/file.t.perm.txt --------x good"); + f8.remove (); + t.notok (f8.exists (), "File::remove perm file no longer exists"); + tmp.remove (); t.notok (tmp.exists (), "tmp dir removed."); diff --git a/test/filter-prefix.t b/test/filter-prefix.t index d3ad2dee3..b4dc3e794 100755 --- a/test/filter-prefix.t +++ b/test/filter-prefix.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 58; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'filter.rc') { diff --git a/test/filter.t b/test/filter.t index e7c5b82dd..70fdd97b0 100755 --- a/test/filter.t +++ b/test/filter.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 156; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'filter.rc') { diff --git a/test/fontunderline.t b/test/fontunderline.t index 5406e8449..8b09f8bd6 100755 --- a/test/fontunderline.t +++ b/test/fontunderline.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'font.rc') { diff --git a/test/history.annual.t b/test/history.annual.t index 9239605c0..967eb94be 100755 --- a/test/history.annual.t +++ b/test/history.annual.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'time.rc') { diff --git a/test/history.monthly.t b/test/history.monthly.t index 0b639de06..df6fbfabf 100755 --- a/test/history.monthly.t +++ b/test/history.monthly.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'time.rc') { diff --git a/test/hyphenate.t b/test/hyphenate.t index c2dc3e1dd..2157d93a5 100755 --- a/test/hyphenate.t +++ b/test/hyphenate.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'bug.rc') { diff --git a/test/i18n.t.cpp b/test/i18n.t.cpp index cfb4fc56c..f7049aeeb 100644 --- a/test/i18n.t.cpp +++ b/test/i18n.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -41,6 +43,10 @@ int main (int argc, char** argv) { UnitTest t (11); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + try { t.is (format ("pre {1} post", "mid"), "pre mid post", "format 1a"); diff --git a/test/ids.t b/test/ids.t index 8c69ddbf2..fdd59a33b 100755 --- a/test/ids.t +++ b/test/ids.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'ids.rc') { diff --git a/test/import.t b/test/import.t index caf4a2ad9..90acae538 100755 --- a/test/import.t +++ b/test/import.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 13; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'import.rc') { diff --git a/test/import.todo.sh.t b/test/import.todo.sh.t index 45da5b7ba..b346bc215 100755 --- a/test/import.todo.sh.t +++ b/test/import.todo.sh.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 26; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + my $source_dir = $0; $source_dir =~ s{[^/]+$}{..}; diff --git a/test/import.yaml.t b/test/import.yaml.t index 0af9a8964..555ee5d5b 100755 --- a/test/import.yaml.t +++ b/test/import.yaml.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 16; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + my $source_dir = $0; $source_dir =~ s{[^/]+$}{..}; @@ -81,10 +85,10 @@ my $output = qx{../src/task rc:import.rc import import.json 2>&1 >/dev/null}; like ($output, qr/Imported 3 tasks\./, '3 tasks imported'); $output = qx{../src/task rc:import.rc list 2>&1}; -# ID Project Pri Due Active Age Description -# -- ------- --- --- ------ ------- ----------- -# 1 A 1.5 yrs zero -# 2 B 1.5 yrs one +# ID Project Age Description +# -- ------- ------- ----------- +# 1 A 1.5 yrs zero +# 2 B 1.5 yrs one # # 2 tasks @@ -93,14 +97,14 @@ like ($output, qr/2.+B.+one/, 't2 present'); unlike ($output, qr/3.+two/, 't3 missing'); $output = qx{../src/task rc:import.rc completed 2>&1}; -# Complete Project Pri Age Description -# --------- ------- --- ------- ----------- -# 2/13/2009 1.5 yrs two +# Complete Age Description +# --------- ------- ----------- +# 2/13/2009 1.5 yrs two # # 1 task -unlike ($output, qr/1.+A.+zero/, 't1 missing'); -unlike ($output, qr/2.+B.+one/, 't2 missing'); +unlike ($output, qr/1.+A.+zero/, 't1 missing'); +unlike ($output, qr/2.+B.+one/, 't2 missing'); like ($output, qr/9\/4\/2011.+two/, 't3 present'); # Make sure that a duplicate task cannot be imported. @@ -144,7 +148,7 @@ like ($output, qr/2.+B.+one/, 't2 present'); like ($output, qr/3.+three/, 't3 present'); # Cleanup. -unlink qw(pending.data completed.data undo.data backlog.data import.rc import.txt import.json); +unlink qw(pending.data completed.data undo.data backlog.data import.rc import.txt import.json); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && diff --git a/test/json.t.cpp b/test/json.t.cpp index c19a08748..02377eda9 100644 --- a/test/json.t.cpp +++ b/test/json.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -105,6 +107,10 @@ int main (int argc, char** argv) { UnitTest t (NUM_POSITIVE_TESTS + NUM_NEGATIVE_TESTS + 22); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + // Positive tests. for (int i = 0; i < NUM_POSITIVE_TESTS; ++i) { diff --git a/test/json_test.cpp b/test/json_test.cpp index d2a266583..2e1430cf8 100644 --- a/test/json_test.cpp +++ b/test/json_test.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include diff --git a/test/json_test.t b/test/json_test.t index 1a5004db7..3ed50fdea 100755 --- a/test/json_test.t +++ b/test/json_test.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + my $source_dir = $0; $source_dir =~ s{[^/]+$}{..}; diff --git a/test/label.t b/test/label.t index 38ac031ab..f0e4bd6c9 100755 --- a/test/label.t +++ b/test/label.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'custom.rc') { diff --git a/test/limit.t b/test/limit.t index aaa70023d..592bc393d 100755 --- a/test/limit.t +++ b/test/limit.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'limit.rc') { diff --git a/test/list.all.projects.t b/test/list.all.projects.t index 1c9b78f83..382e78d3c 100755 --- a/test/list.all.projects.t +++ b/test/list.all.projects.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'projects.rc') { diff --git a/test/list.all.tags.t b/test/list.all.tags.t index 6457e380d..dc33d7c65 100755 --- a/test/list.all.tags.t +++ b/test/list.all.tags.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'tags.rc') { diff --git a/test/list.t.cpp b/test/list.t.cpp index 39c56ac1c..df3768287 100644 --- a/test/list.t.cpp +++ b/test/list.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -37,6 +39,10 @@ int main (int argc, char** argv) { UnitTest t (24); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + // 1,2,3 <=> 2,3,4 std::vector string_one; string_one.push_back ("1"); diff --git a/test/log.t b/test/log.t index 8353dadca..baa382f99 100755 --- a/test/log.t +++ b/test/log.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'log.rc') { diff --git a/test/msg.t.cpp b/test/msg.t.cpp index c856dfeb5..5655b9300 100644 --- a/test/msg.t.cpp +++ b/test/msg.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,10 +25,11 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include -#include #include Context context; @@ -36,25 +37,35 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest t (8); + UnitTest t (12); + + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); Msg m; - t.is (m.serialize (), std::string ("version: ") + PACKAGE_STRING + "\n\n\n", "Msg::serialize '' --> '\\n\\n'"); + t.is (m.serialize (), std::string ("client: ") + PACKAGE_STRING + "\n\n\n", "Msg::serialize '' --> '\\n\\n'"); m.set ("name", "value"); - t.is (m.serialize (), std::string ("name: value\nversion: ") + PACKAGE_STRING + "\n\n\n", "Msg::serialize 1 var"); + t.is (m.serialize (), std::string ("client: ") + PACKAGE_STRING + "\nname: value\n\n\n", "Msg::serialize 1 var"); m.set ("foo", "bar"); - t.is (m.serialize (), std::string ("foo: bar\nname: value\nversion: ") + PACKAGE_STRING + "\n\n\n", "Msg::serialize 2 vars"); + t.is (m.serialize (), std::string ("client: ") + PACKAGE_STRING + "\nfoo: bar\nname: value\n\n\n", "Msg::serialize 2 vars"); m.setPayload ("payload"); - t.is (m.serialize (), std::string ("foo: bar\nname: value\nversion: ") + PACKAGE_STRING + "\n\npayload\n", "Msg::serialize 2 vars + payload"); + t.is (m.serialize (), std::string ("client: ") + PACKAGE_STRING + "\nfoo: bar\nname: value\n\npayload\n", "Msg::serialize 2 vars + payload"); Msg m2; t.ok (m2.parse ("foo: bar\nname: value\n\npayload\n"), "Msg::parse ok"); t.is (m2.get ("foo"), "bar", "Msg::get"); t.is (m2.get ("name"), "value", "Msg::get"); t.is (m2.getPayload (), "payload\n", "Msg::getPayload"); + + Msg m3; + t.ok (m3.parse ("foo:bar\nname: value\n\npayload\n"), "Msg::parse ok"); + t.is (m3.get ("foo"), "bar", "Msg::get"); + t.is (m3.get ("name"), "value", "Msg::get"); + t.is (m3.getPayload (), "payload\n", "Msg::getPayload"); return 0; } diff --git a/test/nag.t b/test/nag.t index ea1240cfa..e9eed8799 100755 --- a/test/nag.t +++ b/test/nag.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'nag.rc') { diff --git a/test/next.t b/test/next.t index 4352e2717..4b7e675b7 100755 --- a/test/next.t +++ b/test/next.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'next.rc') { diff --git a/test/nibbler.t.cpp b/test/nibbler.t.cpp index bdda4a2b5..4c210b8cd 100644 --- a/test/nibbler.t.cpp +++ b/test/nibbler.t.cpp @@ -43,6 +43,7 @@ int main (int argc, char** argv) UnitTest t (408); #else UnitTest t (384); + UnitTest t (378); #endif #else #ifdef NIBBLER_FEATURE_REGEX @@ -52,6 +53,10 @@ int main (int argc, char** argv) #endif #endif + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + try { Nibbler n; diff --git a/test/oldest.t b/test/oldest.t index 7e7ba1295..710a962ae 100755 --- a/test/oldest.t +++ b/test/oldest.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 54; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'oldest.rc') { diff --git a/test/op_and.t b/test/op_and.t index a9793e087..8d7abea03 100755 --- a/test/op_and.t +++ b/test/op_and.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 26; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'op.rc') { diff --git a/test/op_gt.t b/test/op_gt.t index 6cfee941e..ca42e61e9 100755 --- a/test/op_gt.t +++ b/test/op_gt.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 26; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'op.rc') { diff --git a/test/op_gte.t b/test/op_gte.t index 704da2c9b..80292867b 100755 --- a/test/op_gte.t +++ b/test/op_gte.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 14; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'op.rc') { diff --git a/test/op_lt.t b/test/op_lt.t index c7624d8b1..6ff733da2 100755 --- a/test/op_lt.t +++ b/test/op_lt.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 26; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'op.rc') { diff --git a/test/op_lte.t b/test/op_lte.t index 6f22f5dc6..33005fe07 100755 --- a/test/op_lte.t +++ b/test/op_lte.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 14; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'op.rc') { diff --git a/test/op_or.t b/test/op_or.t index c26d3b884..5a60a166a 100755 --- a/test/op_or.t +++ b/test/op_or.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 18; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'op.rc') { diff --git a/test/op_xor.t b/test/op_xor.t index 28d3c5bf6..328196e44 100755 --- a/test/op_xor.t +++ b/test/op_xor.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 18; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'op.rc') { diff --git a/test/overdue.t b/test/overdue.t index 58bb3dff5..735be72b8 100755 --- a/test/overdue.t +++ b/test/overdue.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'due.rc') { diff --git a/test/override.t b/test/override.t index 4a8fe2752..23486d2a0 100755 --- a/test/override.t +++ b/test/override.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 3; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'or.rc') { diff --git a/test/path.t.cpp b/test/path.t.cpp index 026938f8a..a7c3b1ca2 100644 --- a/test/path.t.cpp +++ b/test/path.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,8 +25,11 @@ // //////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include +#include #include Context context; @@ -35,13 +38,17 @@ int main (int argc, char** argv) { UnitTest t (32); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + // Path (); Path p0; - t.ok (p0._data == "", "Path::Path"); + t.is (p0._data, "", "Path::Path"); // Path (const Path&); Path p1 = Path ("foo"); - t.ok (p1._data == "foo", "Path::operator="); + t.is (p1._data, Directory::cwd () + "/foo", "Path::operator="); // Path (const std::string&); Path p2 ("~"); @@ -106,7 +113,7 @@ int main (int argc, char** argv) // bool is_absolute () const; t.notok (p0.is_absolute (), "'' !is_absolute"); - t.notok (p1.is_absolute (), "foo !is_absolute"); + t.ok (p1.is_absolute (), "foo is_absolute"); t.ok (p2.is_absolute (), "~ is_absolute (after expansion)"); t.ok (p3.is_absolute (), "/tmp is_absolute"); t.ok (p4.is_absolute (), "/a/b/c/file.ext is_absolute"); diff --git a/test/prepend.t b/test/prepend.t index 62aa01119..a6ec3a4cf 100755 --- a/test/prepend.t +++ b/test/prepend.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'prepend.rc') { diff --git a/test/pri_sort.t b/test/pri_sort.t index baac89cdb..6d5ddf56a 100755 --- a/test/pri_sort.t +++ b/test/pri_sort.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 34; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'pri.rc') { diff --git a/test/problems b/test/problems index 7dfada892..8f8586901 100755 --- a/test/problems +++ b/test/problems @@ -1,4 +1,4 @@ -#! /usr/bin/env perl +#!/usr/bin/env perl use strict; use warnings; diff --git a/test/project.t b/test/project.t index bea20ee21..73447792a 100755 --- a/test/project.t +++ b/test/project.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 18; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'pro.rc') { diff --git a/test/rc.override.t b/test/rc.override.t index 2aa407f98..457fe46a3 100755 --- a/test/rc.override.t +++ b/test/rc.override.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'rc.rc') { diff --git a/test/rc.t b/test/rc.t index 5f2423055..99c464016 100755 --- a/test/rc.t +++ b/test/rc.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -31,6 +31,10 @@ use warnings; use File::Path; use Test::More tests => 15; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file, using rc.name:value. unlink 'foo.rc'; rmtree 'foo', 0, 0; diff --git a/test/recur.limit.t b/test/recur.limit.t index 8ed5a0f7b..1da4f8ee8 100755 --- a/test/recur.limit.t +++ b/test/recur.limit.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'recur.rc') { diff --git a/test/recur.sort.t b/test/recur.sort.t index 0db5fc825..8341e7233 100755 --- a/test/recur.sort.t +++ b/test/recur.sort.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'recur.rc') { diff --git a/test/recur.t b/test/recur.t index c3076044c..496985987 100755 --- a/test/recur.t +++ b/test/recur.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 11; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'recur.rc') { diff --git a/test/recur.until.t b/test/recur.until.t index b80eec4a4..a1e2b99f1 100755 --- a/test/recur.until.t +++ b/test/recur.until.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'recur.rc') { diff --git a/test/recur.weekdays.t b/test/recur.weekdays.t index 9f1d0b872..59fcba4b2 100755 --- a/test/recur.weekdays.t +++ b/test/recur.weekdays.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'recur.rc') { diff --git a/test/roundtrip.t b/test/roundtrip.t index c22f57330..20d3a3f87 100755 --- a/test/roundtrip.t +++ b/test/roundtrip.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -28,7 +28,11 @@ use strict; use warnings; -use Test::More tests => 4; +use Test::More tests => 5; + +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; # Create the rc file. if (open my $fh, '>', 'roundtrip.rc') @@ -43,36 +47,41 @@ if (open my $fh, '>', 'roundtrip.rc') } # Add two tasks. -qx{../src/task rc:roundtrip.rc add priority:H project:A one 2>&1}; +qx{../src/task rc:roundtrip.rc add priority:H project:A one/1 2>&1}; qx{../src/task rc:roundtrip.rc add +tag1 +tag2 two 2>&1}; # trip 1. -qx{../src/task rc:roundtrip.rc export > ./roundtrip.txt 2>&1}; +qx{../src/task rc:roundtrip.rc export > ./roundtrip1.json 2>&1}; unlink 'pending.data', 'completed.data', 'undo.data'; -qx{../src/task rc:roundtrip.rc rc.debug:1 import ./roundtrip.txt 2>&1}; +qx{../src/task rc:roundtrip.rc rc.debug:1 import ./roundtrip1.json 2>&1}; # trip 2. -qx{../src/task rc:roundtrip.rc export > ./roundtrip.txt 2>&1}; +qx{../src/task rc:roundtrip.rc export > ./roundtrip2.json 2>&1}; unlink 'pending.data', 'completed.data', 'undo.data'; -qx{../src/task rc:roundtrip.rc import ./roundtrip.txt 2>&1}; +qx{../src/task rc:roundtrip.rc import ./roundtrip2.json 2>&1}; # Examine. # ID Project Pri Added Started Due Recur Countdown Age Deps Tags Description # -- ------- --- -------- ------- --- ----- --------- --- ---- --------- --------- -# 1 A H 8/7/2010 - one +# 1 A H 8/7/2010 - one/1 # 2 8/7/2010 - tag1 tag2 two my $output = qx{../src/task rc:roundtrip.rc long 2>&1}; -like ($output, qr/1.+\d+\/\d+\/\d+.+H.+A.+one/, '2 round trips task 1 identical'); +like ($output, qr/1.+A.+H.+\d+\/\d+\/\d+.+(?:-|\d+).+one\/1/, '2 round trips task 1 identical'); like ($output, qr/2.+\d+\/\d+\/\d+.+(?:-|\d+).+tag1\stag2\stwo/, '2 round trips task 2 identical'); +# Compare the actual JSON files. +$output = qx{diff ./roundtrip1.json ./roundtrip2.json 2>&1}; +like ($output, qr/^$/, 'JSON files roundtrip1.json and roundtrip2.json identical'); + # Cleanup. -unlink qw(roundtrip.txt pending.data completed.data undo.data backlog.data roundtrip.rc); -ok (! -r 'roundtrip.txt' && - ! -r 'pending.data' && - ! -r 'completed.data' && - ! -r 'undo.data' && - ! -r 'backlog.data' && +unlink qw(roundtrip1.json roundtrip2.json pending.data completed.data undo.data backlog.data roundtrip.rc); +ok (! -r 'roundtrip1.json' && + ! -r 'roundtrip2.json' && + ! -r 'pending.data' && + ! -r 'completed.data' && + ! -r 'undo.data' && + ! -r 'backlog.data' && ! -r 'roundtrip.rc', 'Cleanup'); exit 0; diff --git a/test/rx.t.cpp b/test/rx.t.cpp index fb0cd35e4..fd3dfd6f6 100644 --- a/test/rx.t.cpp +++ b/test/rx.t.cpp @@ -36,6 +36,10 @@ int main (int argc, char** argv) { UnitTest ut (23); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + std::string text = "This is a test."; RX r1 ("i. ", true); diff --git a/test/sequence.t b/test/sequence.t index 21f7807c4..202545c9e 100755 --- a/test/sequence.t +++ b/test/sequence.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 26; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'seq.rc') { diff --git a/test/shadow.t b/test/shadow.t index 602b4db01..f405bc2fa 100755 --- a/test/shadow.t +++ b/test/shadow.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 18; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'shadow.rc') { @@ -43,16 +47,16 @@ if (open my $fh, '>', 'shadow.rc') } my $output = qx{../src/task rc:shadow.rc add one 2>&1 >/dev/null}; -like ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file updated on add'); +like ($output, qr/\[Shadow file '.+\/shadow\.txt' updated\.\]/, 'shadow file updated on add'); $output = qx{../src/task rc:shadow.rc list 2>&1 >/dev/null}; -unlike ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file not updated on list'); +unlike ($output, qr/\[Shadow file '.+\/shadow\.txt' updated\.\]/, 'shadow file not updated on list'); $output = qx{../src/task rc:shadow.rc 1 delete 2>&1 >/dev/null}; -like ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file updated on delete'); +like ($output, qr/\[Shadow file '.+\/shadow\.txt' updated\.\]/, 'shadow file updated on delete'); $output = qx{../src/task rc:shadow.rc list 2>&1 >/dev/null}; -unlike ($output, qr/\[Shadow file '\.\/shadow\.txt' updated\.\]/, 'shadow file not updated on list'); +unlike ($output, qr/\[Shadow file '.+\/shadow\.txt' updated\.\]/, 'shadow file not updated on list'); # Inspect the shadow file. my $file = slurp ('./shadow.txt'); diff --git a/test/shell.t b/test/shell.t index 4119e6e25..6724e5167 100755 --- a/test/shell.t +++ b/test/shell.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'shell.rc') { diff --git a/test/sorting.t b/test/sorting.t index 10fd77ef0..c43ab8c33 100755 --- a/test/sorting.t +++ b/test/sorting.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 100; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'sorting.rc') { diff --git a/test/special.t b/test/special.t index 6566c80d4..b5d57e895 100755 --- a/test/special.t +++ b/test/special.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'special.rc') { diff --git a/test/start.t b/test/start.t index 737e54578..6ae461bfc 100755 --- a/test/start.t +++ b/test/start.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 17; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'start.rc') { diff --git a/test/subproject.t b/test/subproject.t index 9e3881fe5..911d5b74f 100755 --- a/test/subproject.t +++ b/test/subproject.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'sp.rc') { diff --git a/test/substitute.t b/test/substitute.t index 558ad110e..6b2722c9d 100755 --- a/test/substitute.t +++ b/test/substitute.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 9; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'subst.rc') { diff --git a/test/t.t.cpp b/test/t.t.cpp index 7c7163fb6..253ced4a8 100644 --- a/test/t.t.cpp +++ b/test/t.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,6 +25,8 @@ // //////////////////////////////////////////////////////////////////////////////// +#include +#include #include #include @@ -33,7 +35,11 @@ Context context; //////////////////////////////////////////////////////////////////////////////// int main (int argc, char** argv) { - UnitTest test (37); + UnitTest test (30); + + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); test.is ((int)Task::textToStatus ("pending"), (int)Task::pending, "textToStatus pending"); test.is ((int)Task::textToStatus ("completed"), (int)Task::completed, "textToStatus completed"); @@ -57,7 +63,7 @@ int main (int argc, char** argv) after = t3.composeF4 (); test.is (before, after, "Task::composeF4 -> parse round trip 4 iterations"); - // Legacy Format 1 + // Legacy Format 1 (no longer supported) // [tags] [attributes] description\n // X [tags] [attributes] description\n std::string sample = "[tag1 tag2] [att1:value1 att2:value2] Description"; @@ -69,27 +75,16 @@ int main (int argc, char** argv) try { Task ff1 (sample); } catch (...) { good = false; } test.notok (good, "Support for ff1 removed"); - // Legacy Format 2 + // Legacy Format 2 (no longer supported) // uuid status [tags] [attributes] description\n sample = "00000000-0000-0000-0000-000000000000 " "- " "[tag1 tag2] " "[att1:value1 att2:value2] " "Description"; - Task ff2 (sample); - std::string value = ff2.get ("uuid"); - test.is (value, "00000000-0000-0000-0000-000000000000", "ff2 uuid"); - value = ff2.get ("status"); - test.is (value, "pending", "ff2 status"); - test.ok (ff2.hasTag ("tag1"), "ff2 tag1"); - test.ok (ff2.hasTag ("tag2"), "ff2 tag2"); - test.is (ff2.getTagCount (), 2, "ff2 # tags"); - value = ff2.get ("att1"); - test.is (value, "value1", "ff2 att1"); - value = ff2.get ("att2"); - test.is (value, "value2", "ff2 att2"); - value = ff2.get ("description"); - test.is (value, "Description", "ff2 description"); + good = true; + try { Task ff2 (sample); } catch (...) { good = false; } + test.notok (good, "Support for ff2 removed"); // Legacy Format 3 // uuid status [tags] [attributes] [annotations] description\n @@ -99,13 +94,13 @@ int main (int argc, char** argv) "[att1:value1 att2:value2] " "[123:ann1 456:ann2] Description"; Task ff3 (sample); - value = ff2.get ("uuid"); + std::string value = ff3.get ("uuid"); test.is (value, "00000000-0000-0000-0000-000000000000", "ff3 uuid"); - value = ff2.get ("status"); + value = ff3.get ("status"); test.is (value, "pending", "ff3 status"); - test.ok (ff2.hasTag ("tag1"), "ff3 tag1"); - test.ok (ff2.hasTag ("tag2"), "ff3 tag2"); - test.is (ff2.getTagCount (), 2, "ff3 # tags"); + test.ok (ff3.hasTag ("tag1"), "ff3 tag1"); + test.ok (ff3.hasTag ("tag2"), "ff3 tag2"); + test.is (ff3.getTagCount (), 2, "ff3 # tags"); value = ff3.get ("att1"); test.is (value, "value1", "ff3 att1"); value = ff3.get ("att2"); @@ -117,20 +112,20 @@ int main (int argc, char** argv) // [name:"value" ...]\n sample = "[" "uuid:\"00000000-0000-0000-0000-000000000000\" " - "status:\"P\" " - "tags:\"tag1&commaltag2\" " + "status:\"pending\" " + "tags:\"tag1,tag2\" " "att1:\"value1\" " "att2:\"value2\" " "description:\"Description\"" "]"; Task ff4 (sample); - value = ff2.get ("uuid"); + value = ff4.get ("uuid"); test.is (value, "00000000-0000-0000-0000-000000000000", "ff4 uuid"); - value = ff2.get ("status"); + value = ff4.get ("status"); test.is (value, "pending", "ff4 status"); - test.ok (ff2.hasTag ("tag1"), "ff4 tag1"); - test.ok (ff2.hasTag ("tag2"), "ff4 tag2"); - test.is (ff2.getTagCount (), 2, "ff4 # tags"); + test.ok (ff4.hasTag ("tag1"), "ff4 tag1"); + test.ok (ff4.hasTag ("tag2"), "ff4 tag2"); + test.is (ff4.getTagCount (), 2, "ff4 # tags"); value = ff4.get ("att1"); test.is (value, "value1", "ff4 att1"); value = ff4.get ("att2"); diff --git a/test/t2.t.cpp b/test/t2.t.cpp index a3200726c..0f3fd2af0 100644 --- a/test/t2.t.cpp +++ b/test/t2.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -37,6 +39,10 @@ int main (int argc, char** argv) { UnitTest t (18); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + // (blank) bool good = true; Task task; @@ -76,7 +82,7 @@ int main (int argc, char** argv) // Task::set task.clear (); task.set ("name", "value"); - t.is (task.composeF4 (), "[name:\"value\"]\n", "Task::set"); + t.is (task.composeF4 (), "[name:\"value\"]", "Task::set"); // Task::has t.ok (task.has ("name"), "Task::has"); @@ -84,18 +90,18 @@ int main (int argc, char** argv) // Task::get_int task.set ("one", 1); - t.is (task.composeF4 (), "[name:\"value\" one:\"1\"]\n", "Task::set"); + t.is (task.composeF4 (), "[name:\"value\" one:\"1\"]", "Task::set"); t.is (task.get_int ("one"), 1, "Task::get_int"); // Task::get_ulong task.set ("two", "4294967295"); - t.is (task.composeF4 (), "[name:\"value\" one:\"1\" two:\"4294967295\"]\n", "Task::set"); + t.is (task.composeF4 (), "[name:\"value\" one:\"1\" two:\"4294967295\"]", "Task::set"); t.is ((size_t)task.get_ulong ("two"), (size_t)4294967295UL, "Task::get_ulong"); // Task::remove task.remove ("one"); task.remove ("two"); - t.is (task.composeF4 (), "[name:\"value\"]\n", "Task::remove"); + t.is (task.composeF4 (), "[name:\"value\"]", "Task::remove"); // Task::all t.is (task.size (), (size_t)1, "Task::all size"); diff --git a/test/t3.t.cpp b/test/t3.t.cpp new file mode 100644 index 000000000..d091ecc4d --- /dev/null +++ b/test/t3.t.cpp @@ -0,0 +1,84 @@ +//////////////////////////////////////////////////////////////////////////////// +// taskwarrior - a command line task list manager. +// +// Copyright 2006-2014, 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 +#include +#include +#include +#include +#include + +Context context; + +//////////////////////////////////////////////////////////////////////////////// +int main (int argc, char** argv) +{ + UnitTest t (9); + + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + + Task::attributes["description"] = "string"; + Task::attributes["entry"] = "date"; + Task::attributes["tags"] = "string"; + Task::attributes["uuid"] = "string"; + + bool good = true; + try {Task t1 ("{}");} + catch (const std::string& e){t.diag (e); good = false;} + t.ok (good, "Task::Task ('{}')"); + + good = true; + try {Task t2 ("{\"uuid\":\"00000000-0000-0000-000000000001\",\"description\":\"foo\",\"entry\":\"1234567890\"}");} + catch (const std::string& e){t.diag (e); good = false;} + t.ok (good, "Task::Task ('{}')"); + + // Verify tag handling is correct between F4 and JSON. + Task t3; + t3.set ("entry", "20130602T224000Z"); + t3.set ("description", "DESC"); + t3.addTag ("tag1"); + t.is (t3.composeF4 (), "[description:\"DESC\" entry:\"20130602T224000Z\" tags:\"tag1\"]", "F4 good"); + t.is (t3.composeJSON (), "{\"description\":\"DESC\",\"entry\":\"20130602T224000Z\",\"tags\":[\"tag1\"]}", "JSON good"); + + t3.addTag ("tag2"); + t.is (t3.composeF4 (), "[description:\"DESC\" entry:\"20130602T224000Z\" tags:\"tag1,tag2\"]", "F4 good"); + t.is (t3.composeJSON (), "{\"description\":\"DESC\",\"entry\":\"20130602T224000Z\",\"tags\":[\"tag1\",\"tag2\"]}", "JSON good"); + + good = true; + Task t4; + try {t4 = Task ("{\"description\":\"DESC\",\"entry\":\"20130602T224000Z\",\"tags\":[\"tag1\",\"tag2\"]}");} + catch (const std::string& e){t.diag (e); good = false;} + t.ok (good, "Task::Task ('{two tags}')"); + t.is (t4.composeF4 (), "[description:\"DESC\" entry:\"1370212800\" tags:\"tag1,tag2\"]", "F4 good"); + t.is (t4.composeJSON (), "{\"description\":\"DESC\",\"entry\":\"20130602T224000Z\",\"tags\":[\"tag1\",\"tag2\"]}", "JSON good"); + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/test/tag.t b/test/tag.t index f3ec6d248..a80c87dc4 100755 --- a/test/tag.t +++ b/test/tag.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'tag.rc') { diff --git a/test/taskmod.t.cpp b/test/taskmod.t.cpp index a7feb1f38..338bda033 100644 --- a/test/taskmod.t.cpp +++ b/test/taskmod.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,8 +25,10 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include +#include #include #include #include @@ -40,6 +42,10 @@ int main (int argc, char** argv) { UnitTest t (16); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + bool good = true; // base timestamp diff --git a/test/tdb2.t.cpp b/test/tdb2.t.cpp index 4f1d531be..0c1cce155 100644 --- a/test/tdb2.t.cpp +++ b/test/tdb2.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,9 +25,10 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include - #include #include @@ -38,6 +39,10 @@ int main (int argc, char** argv) { UnitTest t (12); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + try { // Remove any residual test files. @@ -57,7 +62,7 @@ int main (int argc, char** argv) std::vector pending = context.tdb2.pending.get_tasks (); std::vector completed = context.tdb2.completed.get_tasks (); std::vector undo = context.tdb2.undo.get_lines (); - std::vector backlog = context.tdb2.backlog.get_tasks (); + std::vector backlog = context.tdb2.backlog.get_lines (); t.is ((int) pending.size (), 0, "TDB2 Read empty pending"); t.is ((int) completed.size (), 0, "TDB2 Read empty completed"); @@ -71,7 +76,7 @@ int main (int argc, char** argv) pending = context.tdb2.pending.get_tasks (); completed = context.tdb2.completed.get_tasks (); undo = context.tdb2.undo.get_lines (); - backlog = context.tdb2.backlog.get_tasks (); + backlog = context.tdb2.backlog.get_lines (); t.is ((int) pending.size (), 1, "TDB2 after add, 1 pending task"); t.is ((int) completed.size (), 0, "TDB2 after add, 0 completed tasks"); @@ -84,7 +89,7 @@ int main (int argc, char** argv) pending = context.tdb2.pending.get_tasks (); completed = context.tdb2.completed.get_tasks (); undo = context.tdb2.undo.get_lines (); - backlog = context.tdb2.backlog.get_tasks (); + backlog = context.tdb2.backlog.get_lines (); t.is ((int) pending.size (), 1, "TDB2 after add, 1 pending task"); t.is ((int) completed.size (), 0, "TDB2 after add, 0 completed tasks"); diff --git a/test/template.t b/test/template.t index 9c3dba1d8..adaae0dd7 100755 --- a/test/template.t +++ b/test/template.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + use File::Basename; my $ut = basename ($0); my $rc = $ut . '.rc'; diff --git a/test/test.cpp b/test/test.cpp index 8aab28721..1fec701d7 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/test/test.h b/test/test.h index a41ae71e5..e24b4f915 100644 --- a/test/test.h +++ b/test/test.h @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 diff --git a/test/text.t.cpp b/test/text.t.cpp index d196fdaac..d6ef26c36 100644 --- a/test/text.t.cpp +++ b/test/text.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -38,6 +40,10 @@ int main (int argc, char** argv) { UnitTest t (264); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + // void wrapText (std::vector & lines, const std::string& text, const int width, bool hyphenate) std::string text = "This is a test of the line wrapping code."; std::vector lines; diff --git a/test/timesheet.t b/test/timesheet.t index 727757d36..e6f24ed08 100755 --- a/test/timesheet.t +++ b/test/timesheet.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'time.rc') { diff --git a/test/uda_date.t b/test/uda_date.t index c2c521a64..f4a2e67f9 100755 --- a/test/uda_date.t +++ b/test/uda_date.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uda.rc') { diff --git a/test/bug.668.t b/test/uda_defaults.t similarity index 50% rename from test/bug.668.t rename to test/uda_defaults.t index 433fe51b0..62354924b 100755 --- a/test/bug.668.t +++ b/test/uda_defaults.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,33 +30,54 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. -if (open my $fh, '>', 'bug.rc') +if (open my $fh, '>', 'uda.rc') { - print $fh "data.location=.\n"; + print $fh "data.location=.\n", + "confirmation=off\n", + "uda.smell.type=string\n", + "uda.smell.label=Smell\n", + "uda.smell.values=weak,strong\n", + "uda.smell.default=weak\n", + "uda.size.type=numeric\n", + "uda.size.label=Size\n", + "report.uda.description=UDA Test\n", + "report.uda.columns=id,smell,size,description\n", + "report.uda.sort=id\n", + "report.uda.labels=ID,Smell,Size,Description\n"; close $fh; - ok (-r 'bug.rc', 'Created bug.rc'); + ok (-r 'uda.rc', 'Created uda.rc'); } -# Bug 668: URL should allow users with dot character +# Add task with nondefault UDA +my $output = qx{../src/task rc:uda.rc add one smell:strong 2>&1}; +like ($output, qr/Created task 1/, 'Add 1 - no errors'); -my $output = qx{../src/task rc:bug.rc merge user.name\@taskwarrior.org:undo.data 2>&1}; -like ($output, qr/ssh failed/, 'ssh does not connect'); -unlike ($output, qr/not a valid modifier/, 'scp syntax with dots'); -unlike ($output, qr/not in the expected format/, 'scp syntax with dots'); +# Add task without a UDA value, checking for usage of the default +$output = qx{../src/task rc:uda.rc add two 2>&1}; +like ($output, qr/Created task 2/, 'Add 2 - no errors'); + +# Add a task with a UDA that has no default, ensure it is entered fine +$output = qx{../src/task rc:uda.rc add three size:10 2>&1}; +like ($output, qr/Created task 3/, 'Add 3 - no errors'); + +$output = qx{../src/task rc:uda.rc uda 2>&1}; +like ($output, qr/1\s+strong\s+one/, 'UDA nondefault stored'); +like ($output, qr/2\s+weak\s+two/, 'UDA default stored'); +like ($output, qr/3\s+weak\s+10\s+three/, 'UDA without default stored'); -$output = qx{../src/task rc:bug.rc merge ssh://user.name\@taskwarrior.org/undo.data 2>&1}; -like ($output, qr/ssh failed/, 'ssh does not connect'); -unlike ($output, qr/not a valid modifier/, 'standard syntax with dots'); -unlike ($output, qr/not in the expected format/, 'standard syntax with dots'); # Cleanup. -unlink qw(pending.data completed.data undo.data backlog.data bug.rc); +unlink qw(pending.data completed.data undo.data backlog.data uda.rc); ok (! -r 'pending.data' && ! -r 'completed.data' && ! -r 'undo.data' && ! -r 'backlog.data' && - ! -r 'bug.rc', 'Cleanup'); + ! -r 'uda.rc', 'Cleanup'); exit 0; diff --git a/test/uda_duration.t b/test/uda_duration.t index 830b05a25..14e015211 100755 --- a/test/uda_duration.t +++ b/test/uda_duration.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 6; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uda.rc') { diff --git a/test/uda_numeric.t b/test/uda_numeric.t index eb1591dbb..ae91505a3 100755 --- a/test/uda_numeric.t +++ b/test/uda_numeric.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uda.rc') { diff --git a/test/uda_orphan.t b/test/uda_orphan.t index 8961c682f..dc7312451 100755 --- a/test/uda_orphan.t +++ b/test/uda_orphan.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 10; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uda.rc') { diff --git a/test/uda_report.t b/test/uda_report.t index d85f9cabc..7b269e52b 100755 --- a/test/uda_report.t +++ b/test/uda_report.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uda.rc') { diff --git a/test/uda_string.t b/test/uda_string.t index 29757d589..c6affc9b4 100755 --- a/test/uda_string.t +++ b/test/uda_string.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 4; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uda.rc') { diff --git a/test/uda_value.t b/test/uda_value.t index d080f28ad..2086a40ad 100755 --- a/test/uda_value.t +++ b/test/uda_value.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uda.rc') { diff --git a/test/undo.t b/test/undo.t index de9598bdb..a0fe3d7b2 100755 --- a/test/undo.t +++ b/test/undo.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -28,7 +28,11 @@ use strict; use warnings; -use Test::More tests => 11; +use Test::More tests => 20; + +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; # Create the rc file. if (open my $fh, '>', 'undo.rc') @@ -39,12 +43,12 @@ if (open my $fh, '>', 'undo.rc') ok (-r 'undo.rc', 'Created undo.rc'); } -# Test the add/do/undo commands. +# Test the add/done/undo commands. my $output = qx{../src/task rc:undo.rc add one 2>&1; ../src/task rc:undo.rc info 1 2>&1}; ok (-r 'pending.data', 'pending.data created'); like ($output, qr/Status\s+Pending\n/, 'Pending'); -$output = qx{../src/task rc:undo.rc 1 do 2>&1; ../src/task rc:undo.rc info 1 2>&1}; +$output = qx{../src/task rc:undo.rc 1 done 2>&1; ../src/task rc:undo.rc info 1 2>&1}; ok (-r 'completed.data', 'completed.data created'); like ($output, qr/Status\s+Completed\n/, 'Completed'); @@ -60,6 +64,37 @@ $output = qx{../src/task rc:undo.rc undo 1 2>&1}; unlike ($output, qr/Unknown error/, 'No unknown error'); like ($output, qr/The undo command does not allow further task modification/, 'Correct error caught and reported'); +# Add a new task and undo it. +$output = qx{../src/task rc:undo.rc add two 2>&1; ../src/task rc:undo.rc info 1 2>&1}; +unlike ($output, qr/Unknown error/, 'No unknown error'); +like ($output, qr/Status\s+Pending\n/, 'Pending'); + +$output = qx{../src/task rc:undo.rc undo 2>&1; ../src/task rc:undo.rc info 1 2>&1}; +like ($output, qr/Task removed\.\n/, 'Task removed'); +like ($output, qr/No matches\.\n/, 'No matches'); + +# Inspect backlog.data +if (open my $fh, '<', 'backlog.data') +{ + my @lines = <$fh>; + close $fh; + + diag ($_) for @lines; + is (scalar (@lines), 4, '4 lines of backlog'); + ok (index ($lines[0], '"status":"pending"') != -1, '[0] pending'); + ok (index ($lines[1], '"status":"completed"') != -1, '[1] completed'); + ok (index ($lines[2], '"status":"pending"') != -1, '[2] pending'); + ok (index ($lines[3], '"status":"completed"') != -1, '[3] completed'); +} +else +{ + fail ('4 lines of backlog'); + fail ('[0] pending'); + fail ('[1] completed'); + fail ('[2] pending'); + fail ('[3] completed'); +} + # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data undo.rc); ok (! -r 'pending.data' && diff --git a/test/upgrade.t b/test/upgrade.t index 1f6201970..340f65b77 100755 --- a/test/upgrade.t +++ b/test/upgrade.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 7; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'upgrade.rc') { diff --git a/test/urgency.t b/test/urgency.t index 1a82d1088..055a66983 100755 --- a/test/urgency.t +++ b/test/urgency.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -28,7 +28,26 @@ use strict; use warnings; -use Test::More tests => 49; +use Test::More tests => 32; + +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + +sub in_range +{ + my ($value, $low, $high, $message) = @_; + + if ($value >= $low && $value <= $high) + { + pass ($message); + } + else + { + diag ("Expected '$value' to be in the range $low --> $high"); + fail ($message); + } +} # Create the rc file. if (open my $fh, '>', 'urgency.rc') @@ -162,12 +181,6 @@ $output = qx{../src/task rc:urgency.rc 1 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'blocking = 10'); # due -# -# days overdue, capped at 7 -> 0.8 - 1.0 -# due today -> 0.7 -# days until due, capped at 14 -> 0.4 - 0.6 -# has due date -> 0.3 -# no due date -> 0.0 qx{../src/task rc:urgency.rc add 9a due:-10d 2>&1}; # task 18 qx{../src/task rc:urgency.rc add 9b due:-7d 2>&1}; # task 19 @@ -202,93 +215,104 @@ like ($output, qr/urgency 10$/ms, 'due:-10d = 10'); $output = qx{../src/task rc:urgency.rc 19 _urgency 2>&1}; like ($output, qr/urgency 10$/ms, 'due:-7d = 10'); -# due: 9.6 (due:-6d) +# due: ~9.6 (due:-6d) $output = qx{../src/task rc:urgency.rc 20 _urgency 2>&1}; -like ($output, qr/urgency 9.6/ms, 'due:-6d = 9.6'); +my ($value) = $output =~ /urgency\s([0-9.]+)/; +in_range ($value, 9, 10, 'due:-6d = 9 - 10'); -# due: 9.2 (due:-5d) +=pod + +# due: 8.64 (due:-5d) $output = qx{../src/task rc:urgency.rc 21 _urgency 2>&1}; -like ($output, qr/urgency 9.2/ms, 'due:-5d = 9.2'); +like ($output, qr/urgency 8.64/ms, 'due:-5d = 8.64'); -# due: 8.8 (due:-4d) +# due: 8.18 (due:-4d) $output = qx{../src/task rc:urgency.rc 22 _urgency 2>&1}; -like ($output, qr/urgency 8.8/ms, 'due:-4d = 8.8'); +like ($output, qr/urgency 8.18/ms, 'due:-4d = 8.18'); -# due: 8.4 (due:-3d) +# due: 7.73 (due:-3d) $output = qx{../src/task rc:urgency.rc 23 _urgency 2>&1}; -like ($output, qr/urgency 8.4/ms, 'due:-3d = 8.4'); +like ($output, qr/urgency 7.73/ms, 'due:-3d = 7.73'); -# due: 8 (due:-2d) +# due: 7.27 (due:-2d) $output = qx{../src/task rc:urgency.rc 24 _urgency 2>&1}; -like ($output, qr/urgency 8/ms, 'due:-2d = 8'); +like ($output, qr/urgency 7.27/ms, 'due:-2d = 7.27'); -# due: 7.6 (due:-1d) +# due: 6.82 (due:-1d) $output = qx{../src/task rc:urgency.rc 25 _urgency 2>&1}; -like ($output, qr/urgency 7.6/ms, 'due:-1d = 7.6'); +like ($output, qr/urgency 6.82/ms, 'due:-1d = 6.82'); -# due: 7.2 (due:now) +=cut + +# due: ~7.53 (due:now) $output = qx{../src/task rc:urgency.rc 26 _urgency 2>&1}; -like ($output, qr/urgency 7.2$/ms, 'due:now = 7.2'); +($value) = $output =~ /urgency\s([0-9.]+)/; +in_range ($value, 7, 8, 'due:now = 7 - 8'); -# due: 6.8 (due:1d) +=pod + +# due: 5.89 (due:1d) $output = qx{../src/task rc:urgency.rc 27 _urgency 2>&1}; -like ($output, qr/urgency 6.8/ms, 'due:1d = 6.8'); +like ($output, qr/urgency 5.89/ms, 'due:1d = 5.89'); -# due: 6.4 (due:2d) +# due: 5.44(due:2d) $output = qx{../src/task rc:urgency.rc 28 _urgency 2>&1}; -like ($output, qr/urgency 6.4/ms, 'due:2d = 6.4'); +like ($output, qr/urgency 5.44/ms, 'due:2d = 5.44'); -# due: 6 (due:3d) +# due: 4.98 (due:3d) $output = qx{../src/task rc:urgency.rc 29 _urgency 2>&1}; -like ($output, qr/urgency 6/ms, 'due:3d = 6'); +like ($output, qr/urgency 4.98/ms, 'due:3d = 4.98'); -# due: 5.6 (due:4d) +# due: 4.53 (due:4d) $output = qx{../src/task rc:urgency.rc 30 _urgency 2>&1}; -like ($output, qr/urgency 5.6/ms, 'due:4d = 5.6'); +like ($output, qr/urgency 4.53/ms, 'due:4d = 4.53'); -# due: 5.2 (due:5d) +# due: 4.07 (due:5d) $output = qx{../src/task rc:urgency.rc 31 _urgency 2>&1}; -like ($output, qr/urgency 5.2/ms, 'due:5d = 5.2'); +like ($output, qr/urgency 4.07/ms, 'due:5d = 4.07'); -# due: 4.8 (due:6d) +# due: 3.62 (due:6d) $output = qx{../src/task rc:urgency.rc 32 _urgency 2>&1}; -like ($output, qr/urgency 4.8/ms, 'due:6d = 4.8'); +like ($output, qr/urgency 3.62/ms, 'due:6d = 3.62'); -# due: 4.4 (due:7d) +# due: 3.16 (due:7d) $output = qx{../src/task rc:urgency.rc 33 _urgency 2>&1}; -like ($output, qr/urgency 4.4/ms, 'due:7d = 4.4'); +like ($output, qr/urgency 3.16/ms, 'due:7d = 3.16'); -# due: 4 (due:8d) +# due: 2.71 (due:8d) $output = qx{../src/task rc:urgency.rc 34 _urgency 2>&1}; -like ($output, qr/urgency 4/ms, 'due:8d = 4'); +like ($output, qr/urgency 2.71/ms, 'due:8d = 2.71'); -# due: 3.6 (due:9d) +# due: 2.25 (due:9d) $output = qx{../src/task rc:urgency.rc 35 _urgency 2>&1}; -like ($output, qr/urgency 3.6/ms, 'due:9d = 3.6'); +like ($output, qr/urgency 2.25/ms, 'due:9d = 2.25'); -# due: 3.2 (due:10d) +# due: 1.8 (due:10d) $output = qx{../src/task rc:urgency.rc 36 _urgency 2>&1}; -like ($output, qr/urgency 3.2/ms, 'due:10d = 3.2'); +like ($output, qr/urgency 1.8/ms, 'due:10d = 1.8'); -# due: 2.8 (due:11d) +# due: 1.34 (due:11d) $output = qx{../src/task rc:urgency.rc 37 _urgency 2>&1}; -like ($output, qr/urgency 2.8/ms, 'due:11d = 2.8'); +like ($output, qr/urgency 1.34/ms, 'due:11d = 1.34'); -# due: 2.4 (due:12d) +# due: 0.89 (due:12d) $output = qx{../src/task rc:urgency.rc 38 _urgency 2>&1}; -like ($output, qr/urgency 2.4/ms, 'due:12d = 2.4'); +like ($output, qr/urgency 0.89/ms, 'due:12d = 0.89'); -# due: 2 (due:13d) +=cut + +# due: >2 (due:13d) $output = qx{../src/task rc:urgency.rc 39 _urgency 2>&1}; -like ($output, qr/urgency 2/ms, 'due:13d = 2'); +($value) = $output =~ /urgency\s([0-9.]+)/; +in_range ($value, 2, 3, 'due:13d = 2 - 3'); -# due: 1.6 (due:14d) +# due: 2 (due:14d) $output = qx{../src/task rc:urgency.rc 40 _urgency 2>&1}; -like ($output, qr/urgency 1.6/ms, 'due:14d = 1.6'); +like ($output, qr/urgency 2/ms, 'due:14d = 2'); -# due: 1.6 (due:20d) +# due: 2 (due:20d) $output = qx{../src/task rc:urgency.rc 41 _urgency 2>&1}; -like ($output, qr/urgency 1.6$/ms, 'due:20d = 1.6'); +like ($output, qr/urgency 2$/ms, 'due:20d = 2'); # user.project: 10 (pro:PROJECT) + 10 (project) qx{../src/task rc:urgency.rc add 10a project:PROJECT 2>&1}; # task 42 @@ -313,7 +337,7 @@ like ($output, qr/urgency 5$/ms, 'scheduled past = 5'); # urgency values between 0 and 1 qx {../src/task rc:urgency.rc add 13 pri:H 2>&1}; $output = qx{../src/task rc:urgency.rc rc.urgency.priority.coefficient:0.01234 46 info 2>&1}; -like ($output, qr/Urgency 0.01$/ms, 'near-zero urgency is truncated'); +like ($output, qr/Urgency 0\.01$/ms, 'near-zero urgency is truncated'); # Cleanup. unlink qw(pending.data completed.data undo.data backlog.data urgency.rc); diff --git a/test/uri.t.cpp b/test/uri.t.cpp index bda95add5..6d994a1e0 100644 --- a/test/uri.t.cpp +++ b/test/uri.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2010 - 2013, Johannes Schlatow. +// Copyright 2010 - 2014, Johannes Schlatow. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -25,8 +25,10 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include #include +#include #include #include #include @@ -38,6 +40,10 @@ int main (int argc, char** argv) { UnitTest t (54); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + Uri uri1 ("asfd://user@host/folder/"); uri1.parse (); t.is (uri1._user, "user", "Uri::parse() : asdf://user@host/folder/"); diff --git a/test/utf8_tw.t b/test/utf8_tw.t index 5a51047bd..286b89db6 100755 --- a/test/utf8_tw.t +++ b/test/utf8_tw.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 5; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'utf8.rc') { diff --git a/test/util.t.cpp b/test/util.t.cpp index 93eb41d0e..df1e33a92 100644 --- a/test/util.t.cpp +++ b/test/util.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -37,6 +39,10 @@ int main (int argc, char** argv) { UnitTest t (40); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + // TODO bool confirm (const std::string&); // TODO int confirm3 (const std::string&); // TODO int confirm4 (const std::string&); diff --git a/test/uuid.t b/test/uuid.t index 50e3bf5d3..14d11dc14 100755 --- a/test/uuid.t +++ b/test/uuid.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 26; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'uuid.rc') { diff --git a/test/verbose.t b/test/verbose.t index af7947b70..c033a734c 100755 --- a/test/verbose.t +++ b/test/verbose.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 8; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'verbose.rc') { diff --git a/scripts/utils/verify_strings b/test/version.t similarity index 67% rename from scripts/utils/verify_strings rename to test/version.t index b6fc05b66..bcb079aed 100755 --- a/scripts/utils/verify_strings +++ b/test/version.t @@ -1,8 +1,8 @@ -#! /usr/bin/perl +#! /usr/bin/env perl ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -28,30 +28,18 @@ use strict; use warnings; +use Test::More tests => 2; -# Use the en-US.h file, or whatever was specified on the command line. -my $file = scalar @ARGV ? shift @ARGV : 'en-US.h'; +qx{touch version.rc}; -# Find all the defined strings. -my @strings; -if (open my $fh, '<', $file) -{ - while (my $line = <$fh>) - { - push @strings, $1 if $line =~ /\#define\s+(STRING_\S+)/; - } +my $year = (localtime (time))[5] + 1900; - close $fh; -} +my $output = qx{../src/task rc:version.rc version 2>&1}; +like ($output, qr/Copyright \(C\) \d{4} - $year/, 'Copyright is current'); -# Recursively search for all the defined strings, reporting those that are not -# used. -for my $string (@strings) -{ - print "$string is not used\n" - if `git grep $string | grep -v [a-z][a-z]-[A-Z][A-Z].h` eq ''; -} +# Cleanup. +unlink 'version.rc'; +ok (!-r 'version.rc', 'Removed version.rc'); exit 0; -################################################################################ diff --git a/test/view.t.cpp b/test/view.t.cpp index e85fe289c..91ec5dae6 100644 --- a/test/view.t.cpp +++ b/test/view.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include #include @@ -43,6 +45,10 @@ int main (int argc, char** argv) { UnitTest t (2); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + try { // Set up configuration. diff --git a/test/wait.t b/test/wait.t index 6ed2b0ee4..26950b67b 100755 --- a/test/wait.t +++ b/test/wait.t @@ -2,7 +2,7 @@ ################################################################################ ## taskwarrior - a command line task list manager. ## -## Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +## Copyright 2006-2014, 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 @@ -30,6 +30,10 @@ use strict; use warnings; use Test::More tests => 13; +# Ensure environment has no influence. +delete $ENV{'TASKDATA'}; +delete $ENV{'TASKRC'}; + # Create the rc file. if (open my $fh, '>', 'wait.rc') { diff --git a/test/width.t.cpp b/test/width.t.cpp index d0534bdf6..41e7a350c 100644 --- a/test/width.t.cpp +++ b/test/width.t.cpp @@ -1,7 +1,7 @@ //////////////////////////////////////////////////////////////////////////////// // taskwarrior - a command line task list manager. // -// Copyright 2006-2013, Paul Beckingham, Federico Hernandez. +// Copyright 2006-2014, 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 @@ -25,7 +25,9 @@ // //////////////////////////////////////////////////////////////////////////////// +#include #include +#include #include #include @@ -34,6 +36,10 @@ int main (int argc, char** argv) { UnitTest t (16); + // Ensure environment has no influence. + unsetenv ("TASKDATA"); + unsetenv ("TASKRC"); + t.is (mk_wcwidth ('a'), 1, "U+0061 --> 1"); t.is (mk_wcwidth (0x5149), 2, "U+5149 --> 2");