Skip to content
Snippets Groups Projects

F dot in username

Merged Timm Fitschen requested to merge f-dot-in-username into dev
2 files
+ 16
5
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 14
4
@@ -46,7 +46,9 @@ using boost::program_options::positional_options_description;
using boost::program_options::store;
using boost::program_options::value;
using boost::program_options::variables_map;
#ifdef BUILD_ACM
using caosdb::acm::Role;
#endif
auto print_version(bool print) -> void {
if (print) {
@@ -98,6 +100,7 @@ auto execute_query(std::string query) -> void {
}
}
#ifdef BUILD_ACM
auto list_roles() -> void {
std::cout << "Known roles:" << std::endl;
const auto &connection = caosdb::connection::ConnectionManager::GetDefaultConnection();
@@ -125,6 +128,7 @@ auto delete_role(std::string name) {
connection->DeleteSingleRole(name);
std::cout << "OK" << std::endl;
}
#endif
auto main(int argc, const char *argv[]) -> int {
try {
@@ -137,10 +141,14 @@ auto main(int argc, const char *argv[]) -> int {
"retrieve", value<std::string>()->notifier(retrieve_entity_by_id),
"Retrieve an entity by id and print its JSON representation.")(
"execute-query", value<std::string>()->notifier(execute_query),
"Execute a query and print the results")("list-roles", "List all known roles")(
"retrieve-role", value<std::string>()->notifier(retrieve_role), "Retrieve a role by name")(
"create-role", value<std::string>()->notifier(create_role), "Create a new role")(
"delete-role", value<std::string>()->notifier(delete_role), "Create a new role");
"Execute a query and print the results")
#ifdef BUILD_ACM
("list-roles", "List all known roles")(
"retrieve-role", value<std::string>()->notifier(retrieve_role), "Retrieve a role by name")(
"create-role", value<std::string>()->notifier(create_role), "Create a new role")(
"delete-role", value<std::string>()->notifier(delete_role), "Create a new role")
#endif
;
parser.options(desc);
@@ -158,6 +166,7 @@ auto main(int argc, const char *argv[]) -> int {
} else if (vm["version"].as<bool>()) {
} else if (vm.count("test-connection")) {
test_connection();
#ifdef BUILD_ACM
} else if (vm.count("list-roles")) {
list_roles();
} else if (vm.count("retrieve-role")) {
@@ -165,6 +174,7 @@ auto main(int argc, const char *argv[]) -> int {
} else if (vm.count("create-role")) {
} else if (vm.count("delete-role")) {
} else if (vm.count("execute-query")) {
#endif
} else {
print_version(true);
test_connection();
Loading