diff options
author | pius.lee <pius.lee@samsung.com> | 2016-10-10 19:03:12 +0900 |
---|---|---|
committer | pius.lee <pius.lee@samsung.com> | 2016-10-10 19:03:12 +0900 |
commit | a74953c665b4d5c177ebfaf014d2ba61f7e7906a (patch) | |
tree | 79af6a0c77640bd5762312eaa83fe3564e21d010 | |
parent | f15cc24b978a6650d51ccb3d62cef85ec2ad0306 (diff) | |
download | launcher-a74953c665b4d5c177ebfaf014d2ba61f7e7906a.tar.gz launcher-a74953c665b4d5c177ebfaf014d2ba61f7e7906a.tar.bz2 launcher-a74953c665b4d5c177ebfaf014d2ba61f7e7906a.zip |
Now options will be pass to managed launcher
Commanline options will be pass to managed launcher except --standalone and assembly path.
Change-Id: I2e853c23553152fb9291b4d586b50c133a5781ee
-rw-r--r-- | NativeLauncher/src/main.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/NativeLauncher/src/main.cc b/NativeLauncher/src/main.cc index 97ff67c..41c0362 100644 --- a/NativeLauncher/src/main.cc +++ b/NativeLauncher/src/main.cc @@ -3,6 +3,8 @@ #include "utils.h" #include "log.h" +#include <cstdio> +#include <vector> #include <memory> #include <Ecore.h> @@ -16,16 +18,25 @@ int main(int argc, char *argv[]) bool standalone = false; const char* standalonePath = nullptr; + std::vector<char*> vargs; + for (i=1; i<argc; i++) { if (StandaloneOption.compare(argv[i]) == 0) { standalone = true; + + if (i > argc-1) + { + fprintf(stderr, "Assembly path must be after \"--standalone\" option\n"); + return 1; + } + i++; + standalonePath = argv[i]; } else { - if (standalonePath == nullptr) - standalonePath = argv[i]; + vargs.push_back(argv[i]); } } @@ -62,7 +73,10 @@ int main(int argc, char *argv[]) _ERR("Failed to run managed launcher"); return 1; } - if (!runtime->Launch(base.c_str(), standalonePath, argc, argv)) + + int args_len = vargs.size(); + char** args = &vargs[0]; + if (!runtime->Launch(base.c_str(), standalonePath, args_len, args)) { _ERR("Failed to launch"); return 1; |