Parse session-id for emitting signal in rsc-copy 39/262439/3
authorIlho Kim <ilho159.kim@samsung.com>
Wed, 11 Aug 2021 01:49:30 +0000 (10:49 +0900)
committerilho kim <ilho159.kim@samsung.com>
Wed, 11 Aug 2021 07:08:53 +0000 (07:08 +0000)
Change-Id: I86c6ee8e3f7050f1aaf12d48f88111be8c2315c0
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/rsc-copy/include/param_checker.hh
src/rsc-copy/src/param_checker.cc

index 17a85f3..9afb80a 100644 (file)
@@ -37,6 +37,7 @@ class ParamChecker {
  private:
   std::list<RscPathInfo> path_info_list_;
   std::string pkgid_;
+  std::string session_id_;
   uid_t uid_;
   ReqType req_type_ = ReqType::REQ_TYPE_UNKNOWN;
 
index d6ef222..107d3ac 100644 (file)
@@ -42,6 +42,7 @@ ParamChecker::ParamChecker(int argc, char* argv[]) {
 
   options.add_options()
       ("uid,u", bpo::value<int>()->default_value(0), "user id")
+      ("session-id,k", bpo::value<std::string>(), "session id")
       ("path,p", bpo::value<std::vector<std::string>>()->multitoken(),
           "source-destination path")
       ("remove,r", bpo::value<std::string>(), "remove shared resource")
@@ -57,6 +58,8 @@ ParamChecker::ParamChecker(int argc, char* argv[]) {
   for (const bpo::option& o : parsed_options.options) {
     if (o.string_key == "uid") {
       uid_ = static_cast<uid_t>(std::stoi(o.value.front()));
+    } else if (o.string_key == "session-id") {
+      session_id_ = o.value.front();
     } else if (o.string_key == "path") {
       path_info_list_.emplace_back(o.value.front(), o.value.back());
     } else if (o.string_key == "copy" ||