Commit graph

86 commits

Author SHA1 Message Date
Paul Beckingham
bcc9eb3d7a Bug
- Fixed bug where specifying an ID of 0 yielded all completed/deleted tasks
  (thanks to greenskeleton).
2013-09-10 22:00:44 -04:00
Paul Beckingham
d03c4cda8a Build Error
- Many files were missing an explicit cmake.h include.  Some were not including
  it at all.  Now it's used almost everywhere.

(cherry picked from commit 82ae86979c497e6d1d0c6b2b5a55aa379ec82c98)
2013-06-02 13:57:36 -04:00
Paul Beckingham
a1132f0028 Code Cleanup
- Cmake was not updating HAVE_ST_BIRTHTIME.
- NIBBLER_FEATURE_DATE was not properly applied everywhere.
- FEATURE_COLOR was not properly set.
- Some source files failed to include cmake.h, and therefore were not properly
- Removed inefficient use of std::string::substr for guaranteed single character
  strings.
- Integrated Directory::cd.
- Integrated File::ctime, ::btime.
- Integrated Path::operator+.
- Integrated Nibbler::getDigit{2,4,6}.
- Integrated HighResTimer.
  enabling/disabling code.
- All Path objects now expanded internally to absolute form.
- Modified unit tests to accomodate absolute paths.
- Merged new nibbler.t.cpp tests.
- Made various methods const.
- Includes removed from some files, added to others.
2013-05-05 08:33:52 -04:00
Paul Beckingham
773b55d374 Code Cleanup
- Removed L10N define.  It served its purpose.
2013-04-07 23:50:51 -04:00
Paul Beckingham
1dccd29643 Copyright 2013
- Updated copyright notices.
2013-03-04 17:47:12 -05:00
Paul Beckingham
dd1f154376 Bug #1091
- Fixed bug #1091, allowing filters to use 'urgency.over:4.5'.
2013-01-12 16:49:48 -05:00
Paul Beckingham
61ccccabd8 Bug #1031
- Fixed bug #1031, which kept expanding aliases after the '--' operator (thanks
  to Jim B).
- Cleaned up mess in the ChangeLog, which should list features before bugs,
  reported issues before ad hoc issues, and in ascending numerical order.
2012-09-26 23:06:42 -04:00
Louis-Claude Canon
e9abac1d0f Code Cleanup
- Keep date formatting intact in arguments (necessary if the initial string
  contains optional information, as start or end of day).
2012-08-02 00:19:41 -04:00
Paul Beckingham
b702251431 Performance
- When there is only one element in A3, no point firing up the Dijkstra
  shunt of the infix processing.
2012-07-08 14:38:13 -04:00
Paul Beckingham
4d4f286330 Bugs
- Added an A3::is_attr type override for 'recur', which needs to be
  treated as an un-expanded 'string' type, most, but not all of the
  time.
- Documented the above in ColRecur.cpp.
- Modified Command.cpp to recognize both type 'duration' and name 'recur'.
- Removed Command::next_mod_group argument coalescing for date types,
  which was not used anyway.
- Improved the error message for unrecognized durations, which previously
  included the word 'date'.
- Modified unit tests to accomodate the above error message change.
- Added bug.972.t unit tests, which fail, because it isn't fixed yet.
- Made A3::dump const so it can be used anywhere.
2012-07-08 10:47:01 -04:00
Paul Beckingham
d16f434899 Bug #1006, #1024
- Fixed bug #1006, #1024, which caused words like the German 'im' and 'des' in
  a description to be expanded into 'imask' and 'description' (thanks to
  Louis-Claude Canon and Martin U).
- Promoted Louis-Claude Canon in the AUTHORS file, added Martin U.
2012-07-04 16:05:42 -04:00
Paul Beckingham
9fe43611d1 Filter Mods
- Changed split type, to improve filter support.
2012-05-21 08:14:16 -04:00
Paul Beckingham
4f98c8d9b5 Code Cleanup
- Upgraded the magic number 10 to a constant with dynamic debug warning.
2012-05-12 12:43:54 -04:00
Paul Beckingham
f4bfa1b2fd Bug #995
- Fixed bug #995, which mis-parsed UUIDs in filters as other elements (thanks
  to Bryce Harrington).
- Nibbler no longer permits 8-character UUID abbreviations, because too often
  they resemble other forms, such as '1111111d' which looks like a duration.
- Modified unit tests accordingly.
2012-04-29 00:28:28 -04:00
Paul Beckingham
ac4d90f1f6 Feature Pulled
- Removed the feature that allows commands to be piped in to stdin,
  and appended to any existing command line.  This feature is
  conditionally compiled, controlled by the FEATURE_STDIN define in
  main.h
- Many unit tests contained "echo '-- y'", and now use "echo 'y'"
  because the '--' is no longer supported on stdin.
- Thanks to the IRC team for testing, including Bryce Harrington,
  Sam Stuck, Owen Clarke, Greg Grossmeier.
2012-03-17 10:46:05 -04:00
Paul Beckingham
deb12102f6 Delay Decrease
- Reduced the delay to 1ms.  Note: this is still a hack.
- Added error checking around the 'select' call.
2012-03-15 22:34:37 -04:00
Paul Beckingham
c5d3042bbf Delay Increase
- Increased delay to 0.05s.
- Added Sam Stuck to AUTHORS, by way of thanks.
2012-03-15 20:41:15 -04:00
Paul Beckingham
5f13019d05 Ubuntu 'select' Fix
- Added a delay before the 'select' call on STDIN, to allow time for
  the data to buffer.  Experimental patch.
2012-03-15 20:20:08 -04:00
Luke Macken
1358a8302f Portability
Manually include unistd.h in a couple of places get things building with gcc
4.7, which removed it from the global namespace. This fixes the following build
errors:

    src/A3.cpp:283:3: error: 'STDIN_FILENO' was not declared in this scope
    src/commands/CmdEdit.cpp:598:30: error: 'getpid' was not declared in this scope
    src/commands/CmdEdit.cpp:603:47: error: 'chdir' was not declared in this scope

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-02-20 17:31:30 -05:00
Paul Beckingham
7a45db4d0f Feature #891
- Added feature #891, which allows for leftmost partial matches of UUID values.
  Makes direct comparisons for full-length values, and regular expressions for
  partial values.  Note that there is a minimum length of 8 hex digits.
- Added safety parsing mechanism that fails a partial UUID if immediately
  followed by a hex digit.  This allows for numbers longer than 8 digits to not
  be misinterpreted as a UUID.
- Implemented Nibbler::getPartialUUID.
- Implemented unit tests.
@@ -1145,12 +1145,23 @@ const A3 A3::sequence (const A3& input) const

   for (unsigned int i = 0; i < uuids.size (); ++i)
   {
-    if (ids.size ())
+    if (ids.size () + i > 0)
       sequenced.push_back (Arg ("or", Arg::cat_op));

-    sequenced.push_back (Arg ("uuid",        Arg::type_string, Arg::cat_dom));
-    sequenced.push_back (Arg ("=",                             Arg::cat_op));
-    sequenced.push_back (Arg (uuids[i],      Arg::type_string, Arg::cat_literal));
+    // A full-length UUID requires a string comparison.
+    if (uuids[i].length () == 36)
+    {
+      sequenced.push_back (Arg ("uuid",         Arg::type_string, Arg::cat_dom));
+      sequenced.push_back (Arg ("=",                              Arg::cat_op));
+      sequenced.push_back (Arg (uuids[i],       Arg::type_string, Arg::cat_literal));
+    }
+    // A UUID fragment is a leftmost comparison.
+    else
+    {
+      sequenced.push_back (Arg ("uuid",         Arg::type_string, Arg::cat_dom));
+      sequenced.push_back (Arg ("~",                              Arg::cat_op));
+      sequenced.push_back (Arg ("^" + uuids[i], Arg::type_string, Arg::cat_rx));
+    }
   }

   sequenced.push_back (Arg (")", Arg::cat_op));
@@ -1674,11 +1685,11 @@ bool A3::is_uuid (Nibbler& n, std::string& result)
   n.save ();
   result = "";
   std::string uuid;
-  if (n.getUUID (uuid))
+  if (n.getPartialUUID (uuid))
   {
     result += uuid;
     while (n.skip (',') &&
-           n.getUUID (uuid))
+           n.getPartialUUID (uuid))
     {
       result += ',' + uuid;
     }
@@ -1997,13 +2008,13 @@ bool A3::extract_uuid (
   Nibbler n (input);

   std::string uuid;
-  if (n.getUUID (uuid))
+  if (n.getPartialUUID (uuid))
   {
     sequence.push_back (uuid);

     while (n.skip (','))
     {
-      if (!n.getUUID (uuid))
+      if (!n.getPartialUUID (uuid))
         throw std::string (STRING_A3_UUID_AFTER_COMMA);

       sequence.push_back (uuid);
2012-02-19 22:27:40 -05:00
Paul Beckingham
09431caf1c Bug
- Tag matching was being performed using the regex \b<tag>\b, which makes
  taskwarrior dependent on regex lib bugs for basic functionality.  This is
  now modified to use pseudo-operators _hastag_ and _notag_.
2012-02-19 17:20:11 -05:00
Paul Beckingham
28a4947234 Bug #818
- Fixed bug #818, which caused partial tag matching (thanks to Joe Holloway).
- Note that the regex word boundary anchors are different for Solaris
  and Linux, and largely broken on OSX.
- Added unit tests.
2012-02-12 10:42:24 -05:00
Uli Martens
0f60e8c758 Bug #929
- Fixed bug #929, which corrected argument handling for aliases.

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2012-02-12 08:15:45 -05:00
Paul Beckingham
8abc541777 Bug #906
- Fixed bug #906, which caused problems with inverted project matching (thanks
  to Uli Martens).
2012-02-02 23:51:31 -05:00
Paul Beckingham
bff868145d Bug #901
- Fixed bug #901, which was preventing multiple IDs and UUIDs from being used
  as a filter (thanks to Bryce Harrington).
2012-01-30 01:00:45 -05:00
Paul Beckingham
6580095002 Copyright
- Year change.
2012-01-02 23:32:10 -05:00
Paul Beckingham
b35a2f54bb Documentation
- Removed "suspicion" comment about the autovivifying of map keys.
  Credited Dmitriy properly.
2011-12-31 11:39:50 -05:00
Paul Beckingham
2e2521a4cf Bug #892
- Possible fix for bug #892, which I cannot replicate anyway.  This fix
  involves testing my suspicion that std::map autovivifies via
  std::map::operator[], which is not nice.  Will ask Dmitriy to confirm.
2011-12-31 11:00:30 -05:00
Paul Beckingham
52f70f6901 Regexes
- Added support for \< and \> for Solaris (thanks to Owen Clarke).
2011-12-16 07:44:19 -05:00
Matt Kraai
3a4871e975 Signed-off-by: Paul Beckingham <paul@beckingham.net>
Bug #836

 - Make A3 use same the number representation as the user.
2011-11-14 23:46:56 -05:00
Paul Beckingham
01087c0ff4 Bug
- Fixed problem with DOM-checking the 'limit' pseudo-attribute (thanks to
  Barton Meeks).
2011-10-29 23:47:21 -04:00
Federico Hernandez
8116c6a103 License
- moving task from GPL to MIT license
  top level src directory
2011-10-08 00:04:01 +02:00
Paul Beckingham
e069503dff I18N
- Localized A3.
2011-09-26 23:17:33 -04:00
Paul Beckingham
4858931592 Bug #846, Feature #827
- Added feature #827, which allows augmentation of default.command with extra
  arguments, when default.command itself contains mulitple arguments (thanks to
  Aikido Guy).
- Fixed bug #846, which prevented the default.command configuration from
  handling multiple arguments (thanks to Uli Martens).
2011-09-25 11:37:57 -04:00
Paul Beckingham
e478f6626b Bug #835
- Fixed bug #835, which prevented hierarchical projects from being recognized.
2011-09-21 00:19:42 -04:00
Paul Beckingham
d1e52c05d6 Unit Tests
- While fixing bug.360.t, discovered a bigger problem, which is not yet
  fixed.  When a due date is removed from a recurring child task, the
  imask, parent and recur attributes should also be removed.  Similarly
  when a recur frequency is removed from a recurring child task, the
  imask and parent should also be removed.
- Net result: two new failing tests.
2011-09-12 22:57:32 -04:00
Paul Beckingham
c7464a59b3 Parsing
- Tags may no longer begin with a digit.
2011-09-11 00:49:08 -04:00
Paul Beckingham
1994240899 Parsing
- Created A3::is_operator to allow for more complex processing.  Renamed
  old A3::is_operator to A3::which_operator.
2011-09-10 13:25:46 -04:00
Paul Beckingham
38c325d469 Bug - Tag Recognition
- Lowered the precedence of tag detection so that dates and durations are
  recognized first.
- Modified the allowable tokens for a tag to be almost anything.
2011-09-08 22:49:58 -04:00
Paul Beckingham
9ed0c5c86d Shadow Files
- Re-enabled shadow files, but in a new, simpler manner, that allows the
  rc.shadow.command to override settings like color if necessary.
- Modifed A3 to capture program name and store it in the Context.
2011-09-07 00:24:00 -04:00
Paul Beckingham
c62f36ef87 Bug - tags
- Modified A3::is_tag to allow @, # and $ in tag names.
2011-09-06 23:54:31 -04:00
Paul Beckingham
69aa041218 Bug - tags
- Modified A3::is_tag to allow @, # and $ in tag names.
- Reduced the precedence of tag parsing to ensure that durations are
  detected first.
2011-09-06 23:52:38 -04:00
Matt Kraai
ea3f0e8567 Bug #819
- Patch applied to fix problem with parsing, where this:
    aa'a
  is parsed as
    aa 'a

Signed-off-by: Paul Beckingham <paul@beckingham.net>
2011-08-26 02:00:41 -04:00
Paul Beckingham
dab06f8672 Code Cleanup
- All objects now use the same convention for naming members.  The
  consistency is a good thing.
2011-08-25 21:54:28 -04:00
Paul Beckingham
9641dde54f Debug Mode
- No longer generates parsing diagrams if debug mode is off.
2011-08-23 07:14:26 -04:00
Paul Beckingham
589627852f Duration Bug
- Removed the unnecessary ::getInt parse before ::getNumber, which was
  causing "-1.2d" to not parse.
- Removed verbose debug statement.
2011-08-21 23:32:37 -04:00
Paul Beckingham
de9dbbbb3d A3, Arg
- Some attribute values (ie wait:tomorrow) when parsed, need to take
  the data type of the attribute (date) and use that as an implied type
  of the value (date literal).
- Arg renders type-less and category-less values as "", instead of "none".
  Cleaner output.
2011-08-21 14:24:26 -04:00
Paul Beckingham
7aa4efef8d Expression Refactor
- Refactoring complete.  Arg objects now uses enumerations for _type
  and _category, which should help with performance.
2011-08-21 01:06:50 -04:00
Paul Beckingham
215364958e Expressions Refactor - Clarified expansion rules
- Arg now has a _value member that reflects the value in play, rather
  than the input _raw value.  Only _value is used in eval.
- DOM expansion capabilities are now controlled by rc.dom.
2011-08-20 17:06:50 -04:00
Paul Beckingham
438e65036b Expression Refactor
- Arguments are now categorized as either "literal" or a specific
  category, with accompanying type.  Type is inferred for literals,
  and referenced for attributes.
2011-08-20 14:02:48 -04:00