- New 'exec' command that runs external programs, implemented by
  CmdExec.
- Restructured code so that only Commands implements ::read_only
  and ::displays_id methods, while derived objects simply set flags.
- Corrected column alignment in summary report.
This commit is contained in:
Paul Beckingham 2011-05-15 00:18:24 -04:00
parent 52599dca63
commit afc97d566c
11 changed files with 63 additions and 49 deletions

View file

@ -51,13 +51,16 @@ Command* Command::factory (const std::string& name)
////////////////////////////////////////////////////////////////////////////////
Command::Command ()
: _read_only (true)
, _displays_id (true)
{
}
////////////////////////////////////////////////////////////////////////////////
Command::Command (const Command& other)
{
// _all = other._all;
_read_only = other._read_only;
_displays_id = other._displays_id;
}
////////////////////////////////////////////////////////////////////////////////
@ -65,7 +68,8 @@ Command& Command::operator= (const Command& other)
{
if (this != &other)
{
// _all = other._all;
_read_only = other._read_only;
_displays_id = other._displays_id;
}
return *this;
@ -74,8 +78,8 @@ Command& Command::operator= (const Command& other)
////////////////////////////////////////////////////////////////////////////////
bool Command::operator== (const Command& other) const
{
// return _all == other._all;
return false;
return _read_only == other._read_only &&
_displays_id == other._displays_id;
}
////////////////////////////////////////////////////////////////////////////////
@ -86,8 +90,13 @@ Command::~Command ()
////////////////////////////////////////////////////////////////////////////////
bool Command::read_only () const
{
std::cout << "# Command::read_only\n";
return false;
return _read_only;
}
////////////////////////////////////////////////////////////////////////////////
bool Command::displays_id () const
{
return _displays_id;
}
////////////////////////////////////////////////////////////////////////////////