From 91e5a5e02eb14ff3543d950c6bfc662480c62dd9 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 26 Jun 2011 00:43:18 -0400 Subject: [PATCH] Commands - info - When no command is specified, assume 'info' command. --- src/Arguments.cpp | 11 +++++------ src/commands/CmdCustom.cpp | 3 ++- src/en-US.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Arguments.cpp b/src/Arguments.cpp index a06f1a1ec..e63dbd3ac 100644 --- a/src/Arguments.cpp +++ b/src/Arguments.cpp @@ -441,9 +441,10 @@ void Arguments::categorize () // then invoke the default command. if (!found_command) { - if (found_non_sequence) + if (!found_sequence) { // TODO Invoke the default command. + std::cout << "DEFAULT COMMAND\n"; /* // Apply overrides, if any. std::string defaultCommand = config.get ("default.command"); @@ -471,12 +472,10 @@ void Arguments::categorize () // If the command "task 123" is entered, but with no modifier arguments, // then the actual command is assumed to be "info". - else if (!found_non_sequence && - found_sequence) + else if (!found_non_sequence) { - // TODO Invoke the info command. - std::cout << STRING_ASSUME_INFO << "\n"; -// parseCmd.command = "info"; + context.header (STRING_ASSUME_INFO); + push_back (std::make_pair ("information", "command")); } } } diff --git a/src/commands/CmdCustom.cpp b/src/commands/CmdCustom.cpp index b48c162e7..827e42efc 100644 --- a/src/commands/CmdCustom.cpp +++ b/src/commands/CmdCustom.cpp @@ -150,7 +150,8 @@ int CmdCustom::execute (std::string& output) maxlines -= (context.verbose ("blank") ? 1 : 0) + table_header + context.headers.size () - + context.footnotes.size (); + + context.footnotes.size () + + 1; // "X tasks shown ..." // Render. // TODO Consider rc.verbose diff --git a/src/en-US.h b/src/en-US.h index c04adbd86..51cb3f44c 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -247,7 +247,7 @@ #define STRING_NO_HOME "Could not read home directory from the passwd file." #define STRING_TAGS_NO_COMMAS "Tags are not permitted to contain commas." #define STRING_TRIVIAL_INPUT "You must specify a command, or a task ID to modify." -#define STRING_ASSUME_INFO "No command - assuming 'info'" +#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." // Feedback