diff --git a/src/commands/CmdDelete.cpp b/src/commands/CmdDelete.cpp index 3591e52a3..a24e8417b 100644 --- a/src/commands/CmdDelete.cpp +++ b/src/commands/CmdDelete.cpp @@ -45,6 +45,7 @@ CmdDelete::CmdDelete () _description = STRING_CMD_DELETE_USAGE; _read_only = false; _displays_id = false; + _needs_confirm = true; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index b7b019cbc..365d2ac99 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -199,6 +199,7 @@ Command::Command () , _description ("") , _read_only (true) , _displays_id (true) +, _needs_confirm (false) , _permission_quit (false) , _permission_all (false) { @@ -211,6 +212,7 @@ Command::Command (const Command& other) _description = other._description; _read_only = other._read_only; _displays_id = other._displays_id; + _needs_confirm = other._needs_confirm; _permission_quit = other._permission_quit; _permission_all = other._permission_all; } @@ -224,6 +226,7 @@ Command& Command::operator= (const Command& other) _description = other._description; _read_only = other._read_only; _displays_id = other._displays_id; + _needs_confirm = other._needs_confirm; _permission_quit = other._permission_quit; _permission_all = other._permission_all; } @@ -234,10 +237,11 @@ Command& Command::operator= (const Command& other) //////////////////////////////////////////////////////////////////////////////// bool Command::operator== (const Command& other) const { - return _usage == other._usage && - _description == other._description && - _read_only == other._read_only && - _displays_id == other._displays_id; + return _usage == other._usage && + _description == other._description && + _read_only == other._read_only && + _displays_id == other._displays_id && + _needs_confirm == other._needs_confirm; } //////////////////////////////////////////////////////////////////////////////// @@ -589,7 +593,8 @@ bool Command::permission ( // Quantity 1 modifications have optional confirmation, and only (y/n). if (quantity == 1) { - if (!confirmation) + if (!_needs_confirm || + !confirmation) return true; bool answer = confirm (question); @@ -598,7 +603,7 @@ bool Command::permission ( // 1 < Quantity < bulk modifications have optional confirmation, in the (y/n/a/q) // style. - if (quantity < bulk && !confirmation) + if (quantity < bulk && (!_needs_confirm || !confirmation)) return true; int answer = confirm4 (question); diff --git a/src/commands/Command.h b/src/commands/Command.h index 74325901b..d02aa5f65 100644 --- a/src/commands/Command.h +++ b/src/commands/Command.h @@ -75,6 +75,7 @@ protected: std::string _description; bool _read_only; bool _displays_id; + bool _needs_confirm; // Permission support bool _permission_quit;