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:
@@ -28,6 +28,7 @@
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
#include <Context.h>
|
||||
#include <Filter.h>
|
||||
#include <ViewText.h>
|
||||
#ifdef HAVE_COMMIT
|
||||
#include <commit.h>
|
||||
@@ -51,6 +52,12 @@ CmdVersion::CmdVersion ()
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
int CmdVersion::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);
|
||||
|
||||
std::stringstream out;
|
||||
|
||||
// Create a table for the disclaimer.
|
||||
|
||||
Reference in New Issue
Block a user