Skip to content

Commit

Permalink
certify: use bool_switch for permit-gn-mgmt option of generate-ticket…
Browse files Browse the repository at this point in the history
… command

Change-Id: I848c0516d69e776fe780f9f7a82fe91df136c42b
  • Loading branch information
riebl committed Oct 2, 2019
1 parent 4ac0f08 commit 7647dab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions tools/certify/commands/generate-ticket.cpp
Expand Up @@ -31,7 +31,7 @@ bool GenerateTicketCommand::parse(const std::vector<std::string>& opts)
("days", po::value<int>(&validity_days)->default_value(7), "Validity in days.")
("cam-permissions", po::value<std::string>(&cam_permissions), "CAM permissions as binary string (e.g. '1111111111111100' to grant all SSPs)")
("denm-permissions", po::value<std::string>(&denm_permissions), "DENM permissions as binary string (e.g. '000000000000000000000000' to grant no SSPs)")
("permit-gn-mgmt", "Generated ticket can be used to sign GN-MGMT messages (e.g. beacons).")
("permit-gn-mgmt", po::bool_switch(&permit_gn_mgmt), "Generated ticket can be used to sign GN-MGMT messages (e.g. beacons).")
;

po::positional_options_description pos;
Expand All @@ -54,8 +54,6 @@ bool GenerateTicketCommand::parse(const std::vector<std::string>& opts)
return false;
}

permit_gn_mgmt = vm.count("permit-gn-mgmt") > 0;

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion tools/certify/commands/generate-ticket.hpp
Expand Up @@ -17,7 +17,7 @@ class GenerateTicketCommand : public Command
int validity_days;
std::string cam_permissions;
std::string denm_permissions;
bool permit_gn_mgmt;
bool permit_gn_mgmt = false;
};

#endif /* CERTIFY_COMMANDS_GENERATE_TICKET_HPP */

0 comments on commit 7647dab

Please sign in to comment.