mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-09-09 18:50:39 +02:00
Command: Code cleanup, added ::category accessor
- The Command object failed to initialize all member on construction and initialized them out of order (is this still a thing in C++11?). - The _category was the only member with no accessor, which is not right.
This commit is contained in:
parent
77b17379d6
commit
d1fe1279ed
3 changed files with 32 additions and 23 deletions
|
@ -88,7 +88,7 @@ int CmdCommands::execute (std::string& output)
|
|||
{
|
||||
int row = view.addRow ();
|
||||
view.set (row, 0, command.first);
|
||||
view.set (row, 1, Command::categoryNames.at (command.second->_category));
|
||||
view.set (row, 1, Command::categoryNames.at (command.second->category ()));
|
||||
|
||||
if (command.second->read_only ())
|
||||
view.set (row, 2, "RO");
|
||||
|
@ -213,7 +213,7 @@ int CmdZshCommands::execute (std::string& output)
|
|||
std::vector <ZshCommand> commands;
|
||||
for (auto& command : context.commands)
|
||||
{
|
||||
ZshCommand zshCommand {command.second->_category,
|
||||
ZshCommand zshCommand {command.second->category (),
|
||||
command.first,
|
||||
command.second->description ()};
|
||||
commands.push_back (zshCommand);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue