return 0;
}
-static int list_homes(int argc, char *argv[], void *userdata) {
+static int verb_list_homes(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
return 0;
}
-static int activate_home(int argc, char *argv[], void *userdata) {
+static int verb_activate_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r, ret = 0;
return ret;
}
-static int deactivate_home(int argc, char *argv[], void *userdata) {
+static int verb_deactivate_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r, ret = 0;
return 0;
}
-static int inspect_homes(int argc, char *argv[], void *userdata) {
+static int verb_inspect_homes(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r;
}
}
-static int authenticate_homes(int argc, char *argv[], void *userdata) {
+static int verb_authenticate_homes(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r;
return 0;
}
-static int create_home(int argc, char *argv[], void *userdata) {
+static int verb_create_home(int argc, char *argv[], void *userdata) {
int r;
if (argc >= 2) {
return ret;
}
-static int remove_home(int argc, char *argv[], void *userdata) {
+static int verb_remove_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r, ret = 0;
return 0;
}
-static int update_home(int argc, char *argv[], void *userdata) {
+static int verb_update_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(user_record_unrefp) UserRecord *hr = NULL, *secret = NULL;
_cleanup_free_ char *buffer = NULL;
return 0;
}
-static int passwd_home(int argc, char *argv[], void *userdata) {
+static int verb_passwd_home(int argc, char *argv[], void *userdata) {
_cleanup_(user_record_unrefp) UserRecord *old_secret = NULL, *new_secret = NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_free_ char *buffer = NULL;
return 0;
}
-static int resize_home(int argc, char *argv[], void *userdata) {
+static int verb_resize_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
_cleanup_(user_record_unrefp) UserRecord *secret = NULL;
uint64_t ds = UINT64_MAX;
return 0;
}
-static int lock_home(int argc, char *argv[], void *userdata) {
+static int verb_lock_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r, ret = 0;
return ret;
}
-static int unlock_home(int argc, char *argv[], void *userdata) {
+static int verb_unlock_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
int r, ret = 0;
return ret;
}
-static int with_home(int argc, char *argv[], void *userdata) {
+static int verb_with_home(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL, *reply = NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
return ret;
}
-static int lock_all_homes(int argc, char *argv[], void *userdata) {
+static int verb_lock_all_homes(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
return 0;
}
-static int deactivate_all_homes(int argc, char *argv[], void *userdata) {
+static int verb_deactivate_all_homes(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
return 0;
}
-static int rebalance(int argc, char *argv[], void *userdata) {
+static int verb_rebalance(int argc, char *argv[], void *userdata) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_(sd_bus_message_unrefp) sd_bus_message *m = NULL;
_cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL;
return 1;
}
-static int help(int argc, char *argv[], void *userdata) {
+static int help(void) {
_cleanup_free_ char *link = NULL;
int r;
return 0;
}
+static int verb_help(int argc, char *argv[], void *userdata) {
+ return help();
+}
+
static int parse_argv(int argc, char *argv[]) {
_cleanup_strv_free_ char **arg_languages = NULL;
switch (c) {
case 'h':
- return help(0, NULL, NULL);
+ return help();
case ARG_VERSION:
return version();
static int run(int argc, char *argv[]) {
static const Verb verbs[] = {
- { "help", VERB_ANY, VERB_ANY, 0, help },
- { "list", VERB_ANY, 1, VERB_DEFAULT, list_homes },
- { "activate", 2, VERB_ANY, 0, activate_home },
- { "deactivate", 2, VERB_ANY, 0, deactivate_home },
- { "inspect", VERB_ANY, VERB_ANY, 0, inspect_homes },
- { "authenticate", VERB_ANY, VERB_ANY, 0, authenticate_homes },
- { "create", VERB_ANY, 2, 0, create_home },
- { "adopt", VERB_ANY, VERB_ANY, 0, verb_adopt_home },
- { "register", VERB_ANY, VERB_ANY, 0, verb_register_home },
- { "unregister", 2, VERB_ANY, 0, verb_unregister_home },
- { "remove", 2, VERB_ANY, 0, remove_home },
- { "update", VERB_ANY, 2, 0, update_home },
- { "passwd", VERB_ANY, 2, 0, passwd_home },
- { "resize", 2, 3, 0, resize_home },
- { "lock", 2, VERB_ANY, 0, lock_home },
- { "unlock", 2, VERB_ANY, 0, unlock_home },
- { "with", 2, VERB_ANY, 0, with_home },
- { "lock-all", VERB_ANY, 1, 0, lock_all_homes },
- { "deactivate-all", VERB_ANY, 1, 0, deactivate_all_homes },
- { "rebalance", VERB_ANY, 1, 0, rebalance },
- { "firstboot", VERB_ANY, 1, 0, verb_firstboot },
- { "list-signing-keys", VERB_ANY, 1, 0, verb_list_signing_keys },
- { "get-signing-key", VERB_ANY, VERB_ANY, 0, verb_get_signing_key },
- { "add-signing-key", VERB_ANY, VERB_ANY, 0, verb_add_signing_key },
- { "remove-signing-key", 2, VERB_ANY, 0, verb_remove_signing_key },
+ { "help", VERB_ANY, VERB_ANY, 0, verb_help },
+ { "list", VERB_ANY, 1, VERB_DEFAULT, verb_list_homes },
+ { "activate", 2, VERB_ANY, 0, verb_activate_home },
+ { "deactivate", 2, VERB_ANY, 0, verb_deactivate_home },
+ { "inspect", VERB_ANY, VERB_ANY, 0, verb_inspect_homes },
+ { "authenticate", VERB_ANY, VERB_ANY, 0, verb_authenticate_homes },
+ { "create", VERB_ANY, 2, 0, verb_create_home },
+ { "adopt", VERB_ANY, VERB_ANY, 0, verb_adopt_home },
+ { "register", VERB_ANY, VERB_ANY, 0, verb_register_home },
+ { "unregister", 2, VERB_ANY, 0, verb_unregister_home },
+ { "remove", 2, VERB_ANY, 0, verb_remove_home },
+ { "update", VERB_ANY, 2, 0, verb_update_home },
+ { "passwd", VERB_ANY, 2, 0, verb_passwd_home },
+ { "resize", 2, 3, 0, verb_resize_home },
+ { "lock", 2, VERB_ANY, 0, verb_lock_home },
+ { "unlock", 2, VERB_ANY, 0, verb_unlock_home },
+ { "with", 2, VERB_ANY, 0, verb_with_home },
+ { "lock-all", VERB_ANY, 1, 0, verb_lock_all_homes },
+ { "deactivate-all", VERB_ANY, 1, 0, verb_deactivate_all_homes },
+ { "rebalance", VERB_ANY, 1, 0, verb_rebalance },
+ { "firstboot", VERB_ANY, 1, 0, verb_firstboot },
+ { "list-signing-keys", VERB_ANY, 1, 0, verb_list_signing_keys },
+ { "get-signing-key", VERB_ANY, VERB_ANY, 0, verb_get_signing_key },
+ { "add-signing-key", VERB_ANY, VERB_ANY, 0, verb_add_signing_key },
+ { "remove-signing-key", 2, VERB_ANY, 0, verb_remove_signing_key },
{}
};