Add support for running script files (indicated by .mse-script extension) from the command line.

This commit is contained in:
Twan van Laarhoven
2020-04-20 01:38:19 +02:00
parent a2b1d2bd80
commit 3dbd03511f
6 changed files with 55 additions and 17 deletions
+7 -6
View File
@@ -17,15 +17,14 @@
// ----------------------------------------------------------------------------- : Command line interface
class CLISetInterface : public SetView {
public:
public:
/// The set is optional
CLISetInterface(const SetP& set, bool quiet = false);
~CLISetInterface();
protected:
CLISetInterface(const SetP& set, bool quiet = false, bool run = true);
protected:
virtual void onAction(const Action&, bool) {}
virtual void onChangeSet();
virtual void onBeforeChangeSet();
private:
private:
bool quiet; ///< Supress prompts and other non-vital stuff
bool running; ///< Still running?
@@ -40,7 +39,7 @@ class CLISetInterface : public SetView {
/// our own context, when no set is loaded
Context& getContext();
Context* our_context;
unique_ptr<Context> our_context;
size_t scope;
// export info, so we can write files
@@ -48,5 +47,7 @@ class CLISetInterface : public SetView {
void setExportInfoCwd();
};
bool run_script_file(String const& filename);
// ----------------------------------------------------------------------------- : EOF
#endif