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:
@@ -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", ""));
|
||||
|
||||
Reference in New Issue
Block a user