parent
01259bf22c
commit
f3c19ba7fa
|
@ -842,6 +842,9 @@ void define_command(const ParametersParser& parser, Context& context, const Shel
|
|||
const String& cmd_name = parser[0];
|
||||
auto& cm = CommandManager::instance();
|
||||
|
||||
if (contains_that(cmd_name, is_blank))
|
||||
throw runtime_error(format("invalid command name: '{}'", cmd_name));
|
||||
|
||||
if (cm.command_defined(cmd_name) and not parser.get_switch("allow-override"))
|
||||
throw runtime_error(format("command '{}' already defined", cmd_name));
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user