fn usage()

in sources/api/apiclient/src/main.rs [118:195]


fn usage() -> ! {
    let msg = &format!(
        r#"Usage: apiclient [SUBCOMMAND] [OPTION]...

        Global options:
            -s, --socket-path PATH     Override the server socket path.  Default: {socket}
            --log-level                Desired amount of output; trace|debug|info|warn|error
            -v, --verbose              Sets log level to 'debug'.  This prints extra info,
                                       like HTTP status code to stderr in 'raw' mode.

        Subcommands:
            raw                        Makes an HTTP request and prints the response on stdout.
                                       'raw' is the default subcommand and may be omitted.
            apply                      Applies settings from TOML/JSON files at given URIs,
                                       or from stdin.
            get                        Retrieve and print settings.
            set                        Changes settings and applies them to the system.
            update check               Prints information about available updates.
            update apply               Applies available updates.
            update cancel              Deactivates an applied update.
            reboot                     Reboots the host.
            exec                       Execute a command in a host container.

        raw options:
            -u, --uri URI              Required; URI to request from the server, e.g. /tx
            -m, -X, --method METHOD    HTTP method to use in request.  Default: {method}
            -d, --data DATA            Data to include in the request body.  Default: empty

        apply options:
            [ URI ...]                 The list of URIs to TOML or JSON settings files that you
                                       want to apply to the system.  If no URI is specified, or
                                       if "-" is given, reads from stdin.

        reboot options:
            None.

        get options:
            [ PREFIX [PREFIX ...] ]    The settings you want to get.  Full settings names work fine,
                                       or you can specify prefixes to fetch all settings under them.
            [ /desired-uri ]           The API URI to fetch.  Cannot be specified with prefixes.

                                       If neither prefixes nor URI are specified, get will show
                                       settings and OS info.

        set options:
            KEY=VALUE [KEY=VALUE ...]  The settings you want to set.  For example:
                                          settings.motd="hi there" settings.ecs.cluster=example
                                       The "settings." prefix is optional.
                                       Settings with dots in the name require nested quotes:
                                          'kubernetes.node-labels."my.label"=hello'
            -j, --json JSON            Alternatively, you can specify settings in JSON format,
                                       which can simplify setting multiple values, and is necessary
                                       for some numeric settings.  For example:
                                          -j '{{"kernel": {{"sysctl": {{"vm.max_map_count": "262144"}}}}}}'

        update check options:
            None.

        update apply options:
            -c, --check                Automatically `update check` and apply whatever is found.
            -r, --reboot               Automatically reboot if an update was found and applied.

        update cancel options:
            None.

        exec options:
            -t, --tty                  Force the server to run the program in a pseudoterminal.
            -T, --no-tty               Force the server not to run the program in a pseudoterminal.

            TARGET                     Required; the name of the container in which to run the command.
            COMMAND                    Required; the command to run.
            [ ARG ...]                 Any desired arguments to the command."#,
        socket = constants::API_SOCKET,
        method = DEFAULT_METHOD,
    );
    eprintln!("{}", unindent(msg));
    process::exit(2);
}