Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

refactor: restrict remote-command to only one command name #809

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

neverchanje
Copy link
Contributor

No description provided.

}
}
dassert(is_valid_cmd, "should not register empty command");
utils::auto_write_lock l(_lock);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    auto c = new command_instance();
    c->commands = commands;
    c->help_long = help_long;
    c->help_short = help_one_line;
    c->handler = std::move(handler);

    utils::auto_write_lock l(_lock);
    _handlers[cmd] = c;


void command_manager_module_init()
struct command_manager_test : public ::testing::Test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
struct command_manager_test : public ::testing::Test
class command_manager_test : public ::testing::Test

@@ -38,29 +39,19 @@ dsn_handle_t command_manager::register_command(const std::vector<std::string> &c
const std::string &help_long,
command_handler handler)
{
utils::auto_write_lock l(_lock);
bool is_valid_cmd = false;
dcheck_eq(commands.size(), 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So commands can be replaced by const std::string &command ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants