From 8bf2342d5e186f4effaad63e0b8b61b7c0a5baf0 Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Mon, 27 May 2019 16:31:03 +0200 Subject: [PATCH 1/2] Sort command line options alphabetically --- src/gvmd.c | 304 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 223 insertions(+), 81 deletions(-) diff --git a/src/gvmd.c b/src/gvmd.c index c4cabe309..a6c74ab4d 100644 --- a/src/gvmd.c +++ b/src/gvmd.c @@ -1745,98 +1745,240 @@ main (int argc, char** argv) GOptionContext *option_context; static GOptionEntry option_entries[] = { - { "backup", '\0', 0, G_OPTION_ARG_NONE, &backup_database, "Backup the database.", NULL }, - { "check-alerts", '\0', 0, G_OPTION_ARG_NONE, &check_alerts, "Check SecInfo alerts.", NULL }, + { "backup", '\0', 0, G_OPTION_ARG_NONE, + &backup_database, + "Backup the database.", + NULL }, + { "check-alerts", '\0', 0, G_OPTION_ARG_NONE, + &check_alerts, + "Check SecInfo alerts.", + NULL }, { "client-watch-interval", '\0', 0, G_OPTION_ARG_INT, &client_watch_interval, "Check if client connection was closed every seconds." " 0 to disable. Defaults to " G_STRINGIFY (DEFAULT_CLIENT_WATCH_INTERVAL) " seconds.", "" }, - { "database", 'd', 0, G_OPTION_ARG_STRING, &database, "Use as database for SQLite/Postgres.", "" }, - { "disable-cmds", '\0', 0, G_OPTION_ARG_STRING, &disable, "Disable comma-separated .", "" }, + { "create-scanner", '\0', 0, G_OPTION_ARG_STRING, + &create_scanner, + "Create global scanner and exit.", + "" }, + { "create-user", '\0', 0, G_OPTION_ARG_STRING, + &create_user, + "Create admin user and exit.", + "" }, + { "database", 'd', 0, G_OPTION_ARG_STRING, + &database, + "Use as database for SQLite/Postgres.", + "" }, + { "decrypt-all-credentials", '\0', G_OPTION_FLAG_HIDDEN, + G_OPTION_ARG_NONE, + &decrypt_all_credentials, + NULL, + NULL }, + { "delete-scanner", '\0', 0, G_OPTION_ARG_STRING, + &delete_scanner, + "Delete scanner and exit.", + "" }, + { "delete-user", '\0', 0, G_OPTION_ARG_STRING, + &delete_user, + "Delete user and exit.", + "" }, + { "dh-params", '\0', 0, G_OPTION_ARG_STRING, + &dh_params, + "Diffie-Hellman parameters file", + "" }, + { "disable-cmds", '\0', 0, G_OPTION_ARG_STRING, + &disable, + "Disable comma-separated .", + "" }, { "disable-encrypted-credentials", '\0', 0, G_OPTION_ARG_NONE, &disable_encrypted_credentials, - "Do not encrypt or decrypt credentials.", NULL }, - {"disable-password-policy", '\0', 0, G_OPTION_ARG_NONE, - &disable_password_policy, "Do not restrict passwords to the policy.", - NULL}, - { "disable-scheduling", '\0', 0, G_OPTION_ARG_NONE, &disable_scheduling, "Disable task scheduling.", NULL }, - { "create-user", '\0', 0, G_OPTION_ARG_STRING, &create_user, "Create admin user and exit.", "" }, - { "delete-user", '\0', 0, G_OPTION_ARG_STRING, &delete_user, "Delete user and exit.", "" }, - { "get-users", '\0', 0, G_OPTION_ARG_NONE, &get_users, "List users and exit.", NULL }, - { "create-scanner", '\0', 0, G_OPTION_ARG_STRING, &create_scanner, - "Create global scanner and exit.", "" }, - { "modify-scanner", '\0', 0, G_OPTION_ARG_STRING, &modify_scanner, - "Modify scanner and exit.", "" }, - { "scanner-name", '\0', 0, G_OPTION_ARG_STRING, &scanner_name, "Name for --modify-scanner.", "" }, - { "scanner-host", '\0', 0, G_OPTION_ARG_STRING, &scanner_host, - "Scanner host for --create-scanner and --modify-scanner. Default is " OPENVASSD_ADDRESS ".", - "" }, - { "scanner-port", '\0', 0, G_OPTION_ARG_STRING, &scanner_port, - "Scanner port for --create-scanner and --modify-scanner. Default is " G_STRINGIFY (OPENVASSD_PORT) ".", - "" }, - { "scanner-type", '\0', 0, G_OPTION_ARG_STRING, &scanner_type, - "Scanner type for --create-scanner and --modify-scanner. Either 'OpenVAS' or 'OSP'.", - "" }, - { "scanner-ca-pub", '\0', 0, G_OPTION_ARG_STRING, &scanner_ca_pub, - "Scanner CA Certificate path for --[create|modify]-scanner.", "" }, - { "scanner-key-pub", '\0', 0, G_OPTION_ARG_STRING, &scanner_key_pub, - "Scanner Certificate path for --[create|modify]-scanner.", "" }, - { "scanner-key-priv", '\0', 0, G_OPTION_ARG_STRING, &scanner_key_priv, - "Scanner private key path for --[create|modify]-scanner.", "" }, - { "verify-scanner", '\0', 0, G_OPTION_ARG_STRING, &verify_scanner, - "Verify scanner and exit.", "" }, - { "delete-scanner", '\0', 0, G_OPTION_ARG_STRING, &delete_scanner, "Delete scanner and exit.", "" }, - { "get-scanners", '\0', 0, G_OPTION_ARG_NONE, &get_scanners, "List scanners and exit.", NULL }, - { "secinfo-commit-size", '\0', 0, G_OPTION_ARG_INT, &secinfo_commit_size, "During CERT and SCAP sync, commit updates to the database every items, 0 for unlimited, default: " G_STRINGIFY (SECINFO_COMMIT_SIZE_DEFAULT), "" }, - { "schedule-timeout", '\0', 0, G_OPTION_ARG_INT, &schedule_timeout, "Time out tasks that are more than