#ifndef shell_manager_hh_INCLUDED #define shell_manager_hh_INCLUDED #include "array_view.hh" #include "regex.hh" #include "utils.hh" #include "env_vars.hh" #include "flags.hh" namespace Kakoune { class Context; class String; class StringView; using EnvVarRetriever = std::function; class ShellManager : public Singleton { public: ShellManager(); enum class Flags { None = 0, WaitForStdout = 1 }; std::pair eval(StringView cmdline, const Context& context, StringView input = {}, Flags flags = Flags::WaitForStdout, ConstArrayView params = {}, const EnvVarMap& env_vars = EnvVarMap{}); void register_env_var(StringView regex, EnvVarRetriever retriever); String get_val(StringView name, const Context& context) const; private: Vector> m_env_vars; }; template<> struct WithBitOps : std::true_type {}; } #endif // shell_manager_hh_INCLUDED