From 36070dd429af69f1042f4ee56488a960c4d8e7ef Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 31 Jul 2012 14:22:57 +0200 Subject: CommandManager: rework command parser a new type of strings is supported inspired by the ruby strings. %content, if opening delimiter is one of ([{<, then closing delimiter is the matching )]}> and balanced delimiters in the string needs not to be escaped, else the closing delimiter is the same as the opening one. shell expansion is available through %shcommand syntax. Command flags have been removed, as these strings provide proper nesting support, so now, you can for example do: def command %{ echo %sh{ ls } } --- src/command_manager.hh | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/command_manager.hh') diff --git a/src/command_manager.hh b/src/command_manager.hh index 134dbd48..a0609c5e 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -72,13 +72,6 @@ private: class CommandManager : public Singleton { public: - enum Flags - { - None = 0, - IgnoreSemiColons = 1, - DeferredShellEval = 2, - }; - void execute(const String& command_line, const Context& context, const EnvVarMap& env_vars = EnvVarMap()); void execute(const CommandParameters& params, const Context& context, @@ -90,19 +83,16 @@ public: void register_command(const String& command_name, Command command, - unsigned flags = None, const CommandCompleter& completer = CommandCompleter()); void register_commands(const memoryview& command_names, Command command, - unsigned flags = None, const CommandCompleter& completer = CommandCompleter()); private: struct CommandDescriptor { Command command; - unsigned flags; CommandCompleter completer; }; std::unordered_map m_commands; -- cgit v1.2.3