Compare commits

...

22 Commits

Author SHA1 Message Date
Federico Hernandez
12c4983936 Release date for 1.8.4 2009-11-17 12:00:36 +01:00
Paul Beckingham
39d9f235de HACK - case-insensitive file system problem again. 2009-11-16 23:42:32 -05:00
Paul Beckingham
7aa0c3698a HACK - case-insensitive file system problem again. 2009-11-16 23:42:00 -05:00
Paul Beckingham
bc40ab63b3 Bug Fix - #312 Changing one task changes another
- Added a warning when modifying recurring tasks, that all instances of
  that task may be modified.  When task confirms a bulk edit the
  recurrence is again indicated (thanks to Cory Donnelly).
2009-11-16 23:24:47 -05:00
Paul Beckingham
6e673d2834 Bug Fix - #313 Edit command fails when data.location includes spaces
- Applied patch from Cory Donnelly.
2009-11-16 22:10:47 -05:00
Federico Hernandez
30c6dd0047 Added Joe to AUTHORS file 2009-11-13 23:32:40 +01:00
Paul Beckingham
64bc2a165a Bug fix - hang on cygwin when task updated.
- Fixed bug that caused a hang on cygwin, when a task with multiple
  annotations was edited (thanks to Joe Pulliam).
2009-11-09 22:35:51 -05:00
Paul Beckingham
5b96dbbce8 Bug Fix - wait date editing
- The "wait" date was not being properly formatted, as are all the other
  dates, in the "edit" command.  The result is that an epoch integer date
  was rendered, instead of something readable and in the preferred format.
2009-11-09 18:19:04 -05:00
Federico Hernandez
77dd930574 Fixed bug in regexp matching of whitespace between month and year. 2009-11-05 21:36:46 +01:00
Federico Hernandez
f6842941f3 Bumped version number to 1.8.4 2009-10-22 22:40:18 +02:00
Federico Hernandez
e2e0851a69 Merge branch '1.8.3' 2009-10-22 22:27:21 +02:00
Federico Hernandez
1299fe468b Added sha1 for 1.8.3 to Changelog 2009-10-22 22:09:53 +02:00
Federico Hernandez
de50b2902c Merge branch '1.8.3' 2009-10-22 22:02:32 +02:00
Federico Hernandez
bcdcbeeea0 Preparing release
- Updating dist documentation
- Release date in man pages
2009-10-21 22:53:26 +02:00
Pietro Cerutti
469cafa053 Make run_all more portable.
- Changed shebang for portability
- Fix date command for FreeBSD

Signed-off-by: Federico Hernandez <ultrafredde@gmail.com>
2009-10-21 22:20:32 +02:00
Pietro Cerutti
fdb359c180 Fix confirm() to handle EOF
Signed-off-by: Federico Hernandez <ultrafredde@gmail.com>
2009-10-21 22:19:37 +02:00
Paul Beckingham
b3d40b2554 Portability - Haiku R1/alpha1
- Added necessary include files and edits in order to build task on
  Haiku R1/alpha1.
2009-09-27 17:02:20 -04:00
Federico Hernandez
fba076a0d0 Bumped version number to 1.8.3 2009-09-07 16:13:37 +02:00
Federico Hernandez
09d7940dd3 Revert "Bumping version number to 1.8.3"
This reverts commit 00031dc1ab.
2009-09-07 16:04:24 +02:00
Federico Hernandez
00031dc1ab Bumping version number to 1.8.3 2009-09-07 15:52:51 +02:00
Paul Beckingham
3ef844de5f Packaging
- Adding updated package files for OSX, from the 1.8.2 release.
2009-09-07 09:51:20 -04:00
Federico Hernandez
bb45d91ddb Added sha1 of 1.8.2 to ChangLog 2009-09-07 15:41:51 +02:00
28 changed files with 112 additions and 158 deletions

View File

@@ -18,6 +18,7 @@ The following submitted code, packages or analysis, and deserve special thanks:
Johan Friis
Steven de Brouwer
Pietro Cerutti
Cory Donnelly
Thanks to the following, who submitted detailed bug reports and excellent suggestions:
Eugene Kramer
@@ -39,3 +40,4 @@ Thanks to the following, who submitted detailed bug reports and excellent sugges
Thomas@BIC
Ian Mortimer
Zach Frazier
Joe Pulliam

View File

@@ -1,7 +1,23 @@
------ current release ---------------------------
1.8.2 (9/7/2009)
1.8.4 (11/17/2009)
+ Fixed bug that caused wait: dates to not be properly rendered in a
readable and preferred format with the "edit" command.
+ Fixed bug that caused a hang on cygwin, when a task with multiple
annotations was edited (thanks to Joe Pulliam).
+ Fixed bug #314 where the edit command fails when data.location includes
directories containing spaces (thanks to Cory Donnelly).
+ Added a warning (issue #312) when modifying recurring tasks, that all
instances of that task may be modified. When task confirms a bulk edit
the recurrence is again indicated (thanks to Cory Donnelly).
------ old releases ------------------------------
1.8.3 (10/21/2009) bcdcbeeea0d92f21c3565aebfaf6332b959f4025
+ Added support for Haiku R1/alpha1
1.8.2 (9/7/2009) f243f0ed443ecd7dde779de8a6525222591024db
+ Added feature #282 that returns useful exit codes to the shell. Now a
script can detect whether no tasks were returned by a report (thanks to
Pietro Cerutti).
@@ -14,8 +30,6 @@
+ Fixed bug #288 which failed to propagate rc file overrides on the command
line to the default command (thanks to Zach Frazier).
------ old releases ------------------------------
1.8.1 (8/20/2009) 35792e7874d2bb664abb1a0a67960b7fe7e0fccf
+ Fixed bug #231 that broke the build on OpenBSD 32-bit due to a time_t
and int collision (thanks to Pietro Cerutti).

1
NEWS
View File

@@ -26,6 +26,7 @@ Task has been built and tested on the following configurations:
- OpenBSD 4.5
- FreeBSD
- Cygwin 1.5
- Haiku R1/alpha1
While Task has undergone testing, bugs are sure to remain. If you encounter a
bug, please enter a new issue at:

View File

@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT(task, 1.8.2, support@taskwarrior.org)
AC_INIT(task, 1.8.4, support@taskwarrior.org)
CFLAGS="${CFLAGS=}"
CXXFLAGS="${CXXFLAGS=}"

View File

@@ -1,4 +1,4 @@
.TH task-tutorial 5 2009-09-07 "task 1.8.2" "User Manuals"
.TH task-tutorial 5 2009-10-21 "task 1.8.4" "User Manuals"
.SH NAME
task-tutorial \- A tutorial for the task(1) command line todo manager.

View File

@@ -1,4 +1,4 @@
.TH task 1 2009-09-07 "task 1.8.2" "User Manuals"
.TH task 1 2009-10-21 "task 1.8.4" "User Manuals"
.SH NAME
task \- A command line todo manager.

View File

@@ -1,4 +1,4 @@
.TH taskrc 5 2009-09-07 "task 1.8.2" "User Manuals"
.TH taskrc 5 2009-10-21 "task 1.8.4" "User Manuals"
.SH NAME
taskrc \- Configuration file for the task(1) command

View File

@@ -1 +1 @@
<pkg-contents spec="1.12"><f n="task" o="paul" g="staff" p="33261" pt="/Users/paul/task.git/package-config/osx/binary/task" m="false" t="file"/></pkg-contents>
<pkg-contents spec="1.12"><f n="task" o="root" g="wheel" p="33261" pt="/Users/paul/task.git/package-config/osx/binary/task" m="false" t="file"><mod>group</mod><mod>owner</mod></f></pkg-contents>

View File

@@ -1 +1 @@
<pkgref spec="1.12" uuid="C71026FD-E252-42CD-89C3-2F6F087AAF17"><config><identifier>com.beckingham.task180.task.pkg</identifier><version>1.8.0</version><description></description><post-install type="none"/><requireAuthorization/><installFrom mod="true">/Users/paul/task.git/package-config/osx/binary/task</installFrom><installTo mod="true" relocatable="true">/usr/local/bin</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>parent</mod><mod>locationType</mod><mod>relocatable</mod><mod>version</mod><mod>installTo.path</mod><mod>installTo</mod></config><contents><file-list>01task-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
<pkgref spec="1.12" uuid="C71026FD-E252-42CD-89C3-2F6F087AAF17"><config><identifier>com.beckingham.task182.task.pkg</identifier><version>1.8.2</version><description></description><post-install type="none"/><requireAuthorization/><installFrom mod="true">/Users/paul/task.git/package-config/osx/binary/task</installFrom><installTo mod="true" relocatable="true">/usr/local/bin</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>installTo</mod><mod>locationType</mod><mod>relocatable</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod></config><contents><file-list>01task-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>

View File

@@ -1 +1 @@
<pkmkdoc spec="1.12"><properties><title>Task 1.8.0</title><build>/Users/paul/Desktop/task-1.8.0.pkg</build><organization>com.beckingham</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true" system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="task" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.beckingham.task180.task.pkg"/><choice-reqs><requirement id="tosv" operator="ge" value="'10.5.0'" selected="no" enabled="no" hidden="unchanged" startSelected="unchanged" startEnabled="unchanged" startHidden="unchanged"/></choice-reqs></choice></contents><resources bg-scale="proportional" bg-align="center"><locale lang="en"><resource mod="true" type="license">/Users/paul/task.git/package-config/osx/binary/COPYING.txt</resource><resource mod="true" type="readme">/Users/paul/task.git/package-config/osx/binary/README.txt</resource></locale></resources><flags/><item type="file">01task.xml</item><mod>properties.title</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
<pkmkdoc spec="1.12"><properties><title>Task 1.8.2</title><build>/Users/paul/Desktop/task-1.8.2.pkg</build><organization>com.beckingham</organization><userSees ui="both"/><min-target os="3"/><domain anywhere="true" system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><contents><choice title="task" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="com.beckingham.task182.task.pkg"/><choice-reqs><requirement id="tosv" operator="ge" value="'10.6.0'" selected="no" enabled="no" hidden="unchanged" startSelected="unchanged" startEnabled="unchanged" startHidden="unchanged"/></choice-reqs></choice></contents><resources bg-scale="proportional" bg-align="center"><locale lang="en"><resource mod="true" type="license">/Users/paul/task.git/package-config/osx/binary/COPYING.txt</resource><resource mod="true" type="readme">/Users/paul/task.git/package-config/osx/binary/README.txt</resource></locale></resources><flags/><item type="file">01task.xml</item><mod>properties.title</mod><mod>properties.customizeOption</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>

View File

@@ -30,6 +30,7 @@
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "Context.h"
#include "Timer.h"
#include "text.h"

View File

@@ -29,6 +29,7 @@
#include <time.h>
#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include "Date.h"
#include "text.h"
#include "util.h"
@@ -82,14 +83,14 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
// Single or double digit.
case 'm':
if (i >= mdy.length () ||
! ::isdigit (mdy[i]))
! isdigit (mdy[i]))
{
throw std::string ("\"") + mdy + "\" is not a valid date.";
}
if (i + 1 < mdy.length () &&
(mdy[i + 0] == '0' || mdy[i + 0] == '1') &&
::isdigit (mdy[i + 1]))
isdigit (mdy[i + 1]))
{
month = ::atoi (mdy.substr (i, 2).c_str ());
i += 2;
@@ -103,14 +104,14 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
case 'd':
if (i >= mdy.length () ||
! ::isdigit (mdy[i]))
! isdigit (mdy[i]))
{
throw std::string ("\"") + mdy + "\" is not a valid date.";
}
if (i + 1 < mdy.length () &&
(mdy[i + 0] == '0' || mdy[i + 0] == '1' || mdy[i + 0] == '2' || mdy[i + 0] == '3') &&
::isdigit (mdy[i + 1]))
isdigit (mdy[i + 1]))
{
day = ::atoi (mdy.substr (i, 2).c_str ());
i += 2;
@@ -125,8 +126,8 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
// Double digit.
case 'y':
if (i + 1 >= mdy.length () ||
! ::isdigit (mdy[i + 0]) ||
! ::isdigit (mdy[i + 1]))
! isdigit (mdy[i + 0]) ||
! isdigit (mdy[i + 1]))
{
throw std::string ("\"") + mdy + "\" is not a valid date.";
}
@@ -137,8 +138,8 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
case 'M':
if (i + 1 >= mdy.length () ||
! ::isdigit (mdy[i + 0]) ||
! ::isdigit (mdy[i + 1]))
! isdigit (mdy[i + 0]) ||
! isdigit (mdy[i + 1]))
{
throw std::string ("\"") + mdy + "\" is not a valid date.";
}
@@ -149,8 +150,8 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
case 'D':
if (i + 1 >= mdy.length () ||
! ::isdigit (mdy[i + 0]) ||
! ::isdigit (mdy[i + 1]))
! isdigit (mdy[i + 0]) ||
! isdigit (mdy[i + 1]))
{
throw std::string ("\"") + mdy + "\" is not a valid date.";
}
@@ -162,10 +163,10 @@ Date::Date (const std::string& mdy, const std::string& format /* = "m/d/Y" */)
// Quadruple digit.
case 'Y':
if (i + 3 >= mdy.length () ||
! ::isdigit (mdy[i + 0]) ||
! ::isdigit (mdy[i + 1]) ||
! ::isdigit (mdy[i + 2]) ||
! ::isdigit (mdy[i + 3]))
! isdigit (mdy[i + 0]) ||
! isdigit (mdy[i + 1]) ||
! isdigit (mdy[i + 2]) ||
! isdigit (mdy[i + 3]))
{
throw std::string ("\"") + mdy + "\" is not a valid date.";
}

View File

@@ -243,7 +243,7 @@ bool Nibbler::getInt (int& result)
++i;
}
while (i < mInput.length () && ::isdigit (mInput[i]))
while (i < mInput.length () && isdigit (mInput[i]))
++i;
if (i > mCursor)
@@ -260,7 +260,7 @@ bool Nibbler::getInt (int& result)
bool Nibbler::getUnsignedInt (int& result)
{
std::string::size_type i = mCursor;
while (i < mInput.length () && ::isdigit (mInput[i]))
while (i < mInput.length () && isdigit (mInput[i]))
++i;
if (i > mCursor)

View File

@@ -57,8 +57,15 @@ bool Permission::confirmed (const Task& task, const std::string& question)
<< task.id
<< " \""
<< task.get ("description")
<< "\""
<< std::endl;
<< "\"";
if (task.getStatus () == Task::recurring ||
task.has ("parent"))
{
std::cout << " (Recurring)";
}
std::cout << std::endl;
int answer = confirm3 (question);
if (answer == 2)

View File

@@ -153,7 +153,7 @@ bool Sequence::validId (const std::string& input) const
return false;
for (size_t i = 0; i < input.length (); ++i)
if (!::isdigit (input[i]))
if (!isdigit (input[i]))
return false;
return true;

View File

@@ -876,7 +876,7 @@ void Table::sort (std::vector <int>& order)
if (gap > 1)
{
gap = (int) ((float)gap / 1.3);
if (gap == 10 or gap == 9)
if (gap == 10 || gap == 9)
gap = 11;
}

View File

@@ -134,7 +134,7 @@ void Task::setEntry ()
}
////////////////////////////////////////////////////////////////////////////////
Task::status Task::getStatus ()
Task::status Task::getStatus () const
{
return textToStatus (get ("status")); // No i18n
}
@@ -441,10 +441,14 @@ void Task::addAnnotation (const std::string& description)
void Task::removeAnnotations ()
{
// Erase old annotations.
Record::iterator i;
for (i = this->begin (); i != this->end (); ++i)
Record::iterator i = this->begin ();
while (i != this->end ())
{
if (i->first.substr (0, 11) == "annotation_") // No i18n
this->erase (i);
this->erase (i++);
else
i++;
}
}
////////////////////////////////////////////////////////////////////////////////

View File

@@ -57,7 +57,7 @@ public:
void setEntry ();
status getStatus ();
status getStatus () const;
void setStatus (status);
int getTagCount ();

View File

@@ -52,7 +52,7 @@ Timer::~Timer ()
<< mDescription
<< " "
<< std::setprecision (6)
<< std::fixed
// << std::fixed
<< ((end.tv_sec - mStart.tv_sec) + ((end.tv_usec - mStart.tv_usec )
/ 1000000.0))
<< " sec";

View File

@@ -958,6 +958,13 @@ int handleModify (std::string &outs)
task->get ("parent") == other->get ("parent")) || // Sibling
other->get ("uuid") == task->get ("parent")) // Parent
{
if (task->has ("parent"))
std::cout << "Task "
<< task->id
<< " is a recurring task, and all other instances of this"
<< " task may be modified."
<< std::endl;
Task before (*other);
// A non-zero value forces a file write.

View File

@@ -150,7 +150,7 @@ static std::string formatTask (Task task)
<< " Due: " << formatDate (task, "due") << std::endl
<< " Until: " << formatDate (task, "until") << std::endl
<< " Recur: " << task.get ("recur") << std::endl
<< " Wait until: " << task.get ("wait") << std::endl
<< " Wait until: " << formatDate (task, "wait") << std::endl
<< " Parent: " << task.get ("parent") << std::endl
<< " Foreground color: " << task.get ("fg") << std::endl
<< " Background color: " << task.get ("bg") << std::endl
@@ -543,7 +543,7 @@ void editFile (Task& task)
// Complete the command line.
editor += " ";
editor += file.str ();
editor += "\"" + file.str () + "\"";
ARE_THESE_REALLY_HARMFUL:
// Launch the editor.

View File

@@ -106,16 +106,16 @@ static fileType determineFileType (const std::vector <std::string>& lines)
{
if ( lines[i][0] == 'x' &&
lines[i][1] == ' ' &&
::isdigit (lines[i][2]) &&
::isdigit (lines[i][3]) &&
::isdigit (lines[i][4]) &&
::isdigit (lines[i][5]) &&
isdigit (lines[i][2]) &&
isdigit (lines[i][3]) &&
isdigit (lines[i][4]) &&
isdigit (lines[i][5]) &&
lines[i][6] == '-' &&
::isdigit (lines[i][7]) &&
::isdigit (lines[i][8]) &&
isdigit (lines[i][7]) &&
isdigit (lines[i][8]) &&
lines[i][9] == '-' &&
::isdigit (lines[i][10]) &&
::isdigit (lines[i][11]))
isdigit (lines[i][10]) &&
isdigit (lines[i][11]))
return todo_sh_2_0;
}
@@ -126,13 +126,13 @@ static fileType determineFileType (const std::vector <std::string>& lines)
// +project
if (words[w].length () > 1 &&
words[w][0] == '+' &&
::isalnum (words[w][1]))
isalnum (words[w][1]))
return todo_sh_2_0;
// @context
if (words[w].length () > 1 &&
words[w][0] == '@' &&
::isalnum (words[w][1]))
isalnum (words[w][1]))
return todo_sh_2_0;
}
}

View File

@@ -1400,9 +1400,9 @@ std::string renderMonths (
row = 0;
// Loop through days in month and add to table.
for (int d = 1; d <= daysInMonth.at (mpl); ++d)
for (int d = 1; d <= daysInMonth[mpl]; ++d)
{
Date temp (months.at (mpl), d, years.at (mpl));
Date temp (months[mpl], d, years[mpl]);
int dow = temp.dayOfWeek ();
int woy = temp.weekOfYear (weekStart);
@@ -1420,9 +1420,9 @@ std::string renderMonths (
table.addCell (row, thisCol, d);
if ((context.config.get ("color", true) || context.config.get (std::string ("_forcecolor"), false)) &&
today.day () == d &&
today.month () == months.at (mpl) &&
today.year () == years.at (mpl))
today.day () == d &&
today.month () == months[mpl] &&
today.year () == years[mpl])
table.setCellFg (row, thisCol, Text::cyan);
foreach (task, all)
@@ -1434,8 +1434,8 @@ std::string renderMonths (
if ((context.config.get ("color", true) || context.config.get (std::string ("_forcecolor"), false)) &&
due.day () == d &&
due.month () == months.at (mpl) &&
due.year () == years.at (mpl))
due.month () == months[mpl] &&
due.year () == years[mpl])
{
table.setCellFg (row, thisCol, Text::black);
table.setCellBg (row, thisCol, due < today ? Text::on_red : Text::on_yellow);
@@ -1447,7 +1447,7 @@ std::string renderMonths (
int eow = 6;
if (weekStart == 1)
eow = 0;
if (dow == eow && d < daysInMonth.at (mpl))
if (dow == eow && d < daysInMonth[mpl])
row++;
}
}

View File

@@ -1,83 +0,0 @@
////////////////////////////////////////////////////////////////////////////////
// task - a command line task list manager.
//
// Copyright 2006 - 2009, Paul Beckingham.
// All rights reserved.
//
// This program is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free Software
// Foundation; either version 2 of the License, or (at your option) any later
// version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
// details.
//
// You should have received a copy of the GNU General Public License along with
// this program; if not, write to the
//
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor,
// Boston, MA
// 02110-1301
// USA
//
////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDED_TASK
#define INCLUDED_TASK
#include <string>
#include "Record.h"
#include "Subst.h"
#include "Sequence.h"
class Task : public Record
{
public:
Task (); // Default constructor
Task (const Task&); // Copy constructor
Task& operator= (const Task&); // Assignment operator
bool operator== (const Task&); // Comparison operator
Task (const std::string&); // Parse
~Task (); // Destructor
void parse (const std::string&);
std::string composeCSV () const;
// Status values.
enum status {pending, completed, deleted, recurring, waiting};
// Public data.
int id;
// Series of helper functions.
static status textToStatus (const std::string&);
static std::string statusToText (status);
void setEntry ();
status getStatus ();
void setStatus (status);
int getTagCount ();
bool hasTag (const std::string&);
void addTag (const std::string&);
void addTags (const std::vector <std::string>&);
void getTags (std::vector<std::string>&) const;
void removeTag (const std::string&);
void getAnnotations (std::vector <Att>&) const;
void setAnnotations (const std::vector <Att>&);
void addAnnotation (const std::string&);
void removeAnnotations ();
void validate () const;
private:
int determineVersion (const std::string&);
void legacyParse (const std::string&);
};
#endif
////////////////////////////////////////////////////////////////////////////////

View File

@@ -58,7 +58,7 @@ if ( $day <= 9)
# task cal and task cal y
my $output = qx{../task rc:cal.rc rc._forcecolor:on cal};
like ($output, qr/\[36m$day/, 'Current day is highlighted');
like ($output, qr/$month.* $year/, 'Current month and year are displayed');
like ($output, qr/$month\w+?\s+?$year/, 'Current month and year are displayed');
qx{../task rc:cal.rc add zero};
unlike ($output, qr/\[41m\d+/, 'No overdue tasks are present');
unlike ($output, qr/\[43m\d+/, 'No due tasks are present');
@@ -67,9 +67,9 @@ like ($output, qr/Su Mo Tu/, 'Week starts on Sunday');
$output = qx{../task rc:cal.rc rc.weekstart:Monday cal};
like ($output, qr/Fr Sa Su/, 'Week starts on Monday');
$output = qx{../task rc:cal.rc cal y};
like ($output, qr/$month.* $year/, 'Current month and year are displayed');
like ($output, qr/$prevmonth.* $nextyear/, 'Month and year one year ahead are displayed');
unlike ($output, qr/$month.* $nextyear/, 'Current month and year ahead are not displayed');
like ($output, qr/$month\w+?\s+?$year/, 'Current month and year are displayed');
like ($output, qr/$prevmonth\w+?\s+?$nextyear/, 'Month and year one year ahead are displayed');
unlike ($output, qr/$month\w+?\s+?$nextyear/, 'Current month and year ahead are not displayed');
# task cal due and task cal due y
qx{../task rc:cal.rc add due:20190515 one};

View File

@@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/sh
date > all.log
@@ -14,7 +14,7 @@ END=`tail -1 all.log`
OS=`uname`
case $OS in
Darwin)
Darwin | FreeBSD)
STARTEPOCH=`date -j -f "%a %b %d %T %Z %Y" "${START}" "+%s"`
ENDEPOCH=`date -j -f "%a %b %d %T %Z %Y" "${END}" "+%s"`
;;

View File

@@ -209,7 +209,7 @@ std::string commify (const std::string& data)
int i;
for (int i = 0; i < (int) data.length (); ++i)
{
if (::isdigit (data[i]))
if (isdigit (data[i]))
end = i;
if (data[i] == '.')
@@ -227,11 +227,11 @@ std::string commify (const std::string& data)
int consecutiveDigits = 0;
for (; i >= 0; --i)
{
if (::isdigit (data[i]))
if (isdigit (data[i]))
{
result += data[i];
if (++consecutiveDigits == 3 && i && ::isdigit (data[i - 1]))
if (++consecutiveDigits == 3 && i && isdigit (data[i - 1]))
{
result += ',';
consecutiveDigits = 0;
@@ -251,11 +251,11 @@ std::string commify (const std::string& data)
int consecutiveDigits = 0;
for (; i >= 0; --i)
{
if (::isdigit (data[i]))
if (isdigit (data[i]))
{
result += data[i];
if (++consecutiveDigits == 3 && i && ::isdigit (data[i - 1]))
if (++consecutiveDigits == 3 && i && isdigit (data[i - 1]))
{
result += ',';
consecutiveDigits = 0;
@@ -279,8 +279,8 @@ std::string lowerCase (const std::string& input)
{
std::string output = input;
for (int i = 0; i < (int) input.length (); ++i)
if (::isupper (input[i]))
output[i] = ::tolower (input[i]);
if (isupper (input[i]))
output[i] = tolower (input[i]);
return output;
}
@@ -290,8 +290,8 @@ std::string upperCase (const std::string& input)
{
std::string output = input;
for (int i = 0; i < (int) input.length (); ++i)
if (::islower (input[i]))
output[i] = ::toupper (input[i]);
if (islower (input[i]))
output[i] = toupper (input[i]);
return output;
}
@@ -302,7 +302,7 @@ std::string ucFirst (const std::string& input)
std::string output = input;
if (output.length () > 0)
output[0] = ::toupper (output[0]);
output[0] = toupper (output[0]);
return output;
}
@@ -352,7 +352,7 @@ void guess (
bool digitsOnly (const std::string& input)
{
for (size_t i = 0; i < input.length (); ++i)
if (!::isdigit (input[i]))
if (!isdigit (input[i]))
return false;
return true;
@@ -362,7 +362,7 @@ bool digitsOnly (const std::string& input)
bool noSpaces (const std::string& input)
{
for (size_t i = 0; i < input.length (); ++i)
if (::isspace (input[i]))
if (isspace (input[i]))
return false;
return true;

View File

@@ -64,7 +64,7 @@ bool confirm (const std::string& question)
<< " ";
std::getline (std::cin, answer);
answer = lowerCase (trim (answer));
answer = std::cin.eof() ? "no" : lowerCase (trim (answer));
}
while (answer != "y" && // TODO i18n
answer != "ye" && // TODO i18n