diff --git a/src/CLI.cpp b/src/CLI.cpp index 75dc04ae2..9f29cc3b9 100644 --- a/src/CLI.cpp +++ b/src/CLI.cpp @@ -482,6 +482,15 @@ bool CLI::canonicalize ( return false; } +//////////////////////////////////////////////////////////////////////////////// +std::string CLI::getBinary () const +{ + if (_args.size ()) + return _args[0].attribute ("raw"); + + return ""; +} + //////////////////////////////////////////////////////////////////////////////// std::string CLI::getCommand () const { diff --git a/src/CLI.h b/src/CLI.h index ba6f06499..4c643a3ba 100644 --- a/src/CLI.h +++ b/src/CLI.h @@ -75,6 +75,7 @@ public: const std::vector getWords (); const std::vector getModifications (); bool canonicalize (std::string&, const std::string&, const std::string&) const; + std::string getBinary () const; std::string getCommand () const; std::string getLimit () const; const std::string dump (const std::string& title = "CLI Parser") const; diff --git a/src/DOM.cpp b/src/DOM.cpp index 97ef0dd3d..eab6b214b 100644 --- a/src/DOM.cpp +++ b/src/DOM.cpp @@ -104,7 +104,7 @@ bool DOM::get (const std::string& name, Variant& value) { if (name == "context.program") { - value = Variant (context.program); + value = Variant (context.cli.getBinary ()); return true; } else if (name == "context.args") diff --git a/test/dom.t.cpp b/test/dom.t.cpp index 8bcebfd6b..2be1dc7be 100644 --- a/test/dom.t.cpp +++ b/test/dom.t.cpp @@ -48,7 +48,6 @@ int main (int argc, char** argv) // Prime the pump. const char* fake_argv[] = {"task"}; context.cli.initialize (1, fake_argv); - context.program = "task"; context.config.set ("name", "value"); DOM dom;