mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-08 15:20:36 +02:00
Feature: Extra arg detection
- Commands that do not accept filters or modifications now generate an error when extra arguments are specified.
This commit is contained in:
parent
8684639f72
commit
5f30c9e2c3
21 changed files with 72 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <CmdHelp.h>
|
||||
#include <ViewText.h>
|
||||
#include <Context.h>
|
||||
#include <Filter.h>
|
||||
#include <i18n.h>
|
||||
#include <text.h>
|
||||
#include <util.h>
|
||||
|
@ -48,6 +49,12 @@ CmdHelp::CmdHelp ()
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdHelp::execute (std::string& output)
|
||||
{
|
||||
Filter filter;
|
||||
if (filter.hasFilter ())
|
||||
throw std::string (STRING_ERROR_NO_FILTER);
|
||||
if (filter.hasModifications ())
|
||||
throw std::string (STRING_ERROR_NO_MODS);
|
||||
|
||||
ViewText view;
|
||||
view.width (context.getWidth ());
|
||||
view.add (Column::factory ("string.left", ""));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue