提交 fc23bef7 编写于 作者: L lifeng68

clean code:remove unused head file

Signed-off-by: Nlifeng68 <lifeng68@huawei.com>
上级 d2ea15de
......@@ -1462,8 +1462,8 @@ int cmd_create_main(int argc, const char **argv)
}
g_cmd_create_args.progname = argv[0];
g_cmd_create_args.subcommand = argv[1];
struct command_option options[] = { LOG_OPTIONS(lconf), CREATE_OPTIONS(g_cmd_create_args),
CREATE_EXTEND_OPTIONS(g_cmd_create_args), COMMON_OPTIONS(g_cmd_create_args)
struct command_option options[] = { LOG_OPTIONS(lconf) CREATE_OPTIONS(g_cmd_create_args) CREATE_EXTEND_OPTIONS(
g_cmd_create_args) COMMON_OPTIONS(g_cmd_create_args)
};
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_create_desc,
......
......@@ -414,16 +414,17 @@ extern "C" {
&(cmdargs).custom_conf.ns_change_opt, \
"Namespaced kernel param options for system container (default [])", \
NULL }, \
{ \
CMD_OPT_TYPE_CALLBACK, false, "ulimit", 0, &(cmdargs).custom_conf.ulimits, "Ulimit options (default [])", \
command_append_array \
}
{ CMD_OPT_TYPE_CALLBACK, false, "ulimit", 0, &(cmdargs).custom_conf.ulimits, "Ulimit options (default [])", \
command_append_array },
#define CREATE_EXTEND_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_BOOL, false, "interactive", 'i', &(cmdargs).custom_conf.open_stdin, \
"Keep STDIN open even if not attached", NULL \
}
#define CREATE_EXTEND_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, \
false, \
"interactive", \
'i', \
&(cmdargs).custom_conf.open_stdin, \
"Keep STDIN open even if not attached", \
NULL },
extern const char g_cmd_create_desc[];
extern const char g_cmd_create_usage[];
......
......@@ -89,8 +89,8 @@ int cmd_kill_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_kill_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_kill_args),
KILL_OPTIONS(g_cmd_kill_args)
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_kill_args)
KILL_OPTIONS(g_cmd_kill_args)
};
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_kill_desc,
g_cmd_kill_usage);
......
......@@ -19,18 +19,20 @@
#include <stddef.h>
#include "client_arguments.h"
#include "wait.h"
#include "command_parser.h"
#ifdef __cplusplus
extern "C" {
#endif
#define KILL_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_STRING, false, "signal", 's', &(cmdargs).signal, \
"Signal to send to the container (default \"SIGKILL\")", NULL \
}
#define KILL_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_STRING, \
false, \
"signal", \
's', \
&(cmdargs).signal, \
"Signal to send to the container (default \"SIGKILL\")", \
NULL },
extern const char g_cmd_kill_desc[];
extern const char g_cmd_kill_usage[];
......
......@@ -66,7 +66,7 @@ int cmd_rename_main(int argc, const char **argv)
{
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_rename_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_rename_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_rename_args)) {
......
......@@ -70,8 +70,8 @@ int cmd_restart_main(int argc, const char **argv)
int status = 0;
command_t cmd;
struct isula_libutils_log_config lconf = { 0 };
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_restart_args),
RESTART_OPTIONS(g_cmd_restart_args)
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_restart_args)
RESTART_OPTIONS(g_cmd_restart_args)
};
isula_libutils_default_log_config(argv[0], &lconf);
......
......@@ -23,9 +23,14 @@
extern "C" {
#endif
#define RESTART_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_CALLBACK, false, "time", 't', &(cmdargs).time, \
"Seconds to wait for stop before killing it (default 10)", command_convert_int }
#define RESTART_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_CALLBACK, \
false, \
"time", \
't', \
&(cmdargs).time, \
"Seconds to wait for stop before killing it (default 10)", \
command_convert_int },
extern const char g_cmd_restart_desc[];
extern const char g_cmd_restart_usage[];
......@@ -37,4 +42,3 @@ int cmd_restart_main(int argc, const char **argv);
#endif
#endif /* __CMD_RESTART_H */
......@@ -114,8 +114,8 @@ int cmd_delete_main(int argc, const char **argv)
bool status = false;
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_delete_args),
DELETE_OPTIONS(g_cmd_delete_args)
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_delete_args)
DELETE_OPTIONS(g_cmd_delete_args)
};
isula_libutils_default_log_config(argv[0], &lconf);
......
......@@ -25,18 +25,21 @@
extern "C" {
#endif
#define DELETE_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, \
false, \
"force", \
'f', \
&(cmdargs).force, \
"Force the removal of a running container (uses SIGKILL)", \
NULL }, \
{ \
CMD_OPT_TYPE_BOOL, false, "volumes", 'v', &(cmdargs).volume, \
"Remove the volumes associated with the container", NULL \
}
#define DELETE_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, \
false, \
"force", \
'f', \
&(cmdargs).force, \
"Force the removal of a running container (uses SIGKILL)", \
NULL }, \
{ CMD_OPT_TYPE_BOOL, \
false, \
"volumes", \
'v', \
&(cmdargs).volume, \
"Remove the volumes associated with the container", \
NULL },
extern const char g_cmd_delete_desc[];
extern const char g_cmd_delete_usage[];
......
......@@ -244,9 +244,8 @@ int cmd_run_main(int argc, const char **argv)
g_cmd_run_args.progname = argv[0];
g_cmd_run_args.subcommand = argv[1];
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_run_args),
CREATE_OPTIONS(g_cmd_run_args), CREATE_EXTEND_OPTIONS(g_cmd_run_args),
RUN_OPTIONS(g_cmd_run_args)
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_run_args) CREATE_OPTIONS(g_cmd_run_args)
CREATE_EXTEND_OPTIONS(g_cmd_run_args) RUN_OPTIONS(g_cmd_run_args)
};
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_run_desc,
g_cmd_run_usage);
......
......@@ -20,7 +20,6 @@
#include "create.h"
#include "start.h"
#include "wait.h"
#include "client_arguments.h"
#include "command_parser.h"
......@@ -28,11 +27,21 @@
extern "C" {
#endif
#define RUN_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, false, "detach", 'd', &(cmdargs).detach, \
"Run container in background and print container ID", NULL }, \
{ CMD_OPT_TYPE_BOOL, false, "rm", 0, &(cmdargs).custom_conf.auto_remove, \
"Automatically remove the container when it exits", NULL }
#define RUN_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, \
false, \
"detach", \
'd', \
&(cmdargs).detach, \
"Run container in background and print container ID", \
NULL }, \
{ CMD_OPT_TYPE_BOOL, \
false, \
"rm", \
0, \
&(cmdargs).custom_conf.auto_remove, \
"Automatically remove the container when it exits", \
NULL },
extern const char g_cmd_run_desc[];
extern const char g_cmd_run_usage[];
......@@ -44,4 +53,3 @@ int cmd_run_main(int argc, const char **argv);
#endif
#endif /* __CMD_RUN_H */
......@@ -200,7 +200,7 @@ int cmd_start_main(int argc, const char **argv)
int i = 0;
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_start_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_start_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_start_args)) {
......
......@@ -75,8 +75,8 @@ int cmd_stop_main(int argc, const char **argv)
int status = 0;
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_stop_args),
STOP_OPTIONS(g_cmd_stop_args)
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_stop_args)
STOP_OPTIONS(g_cmd_stop_args)
};
isula_libutils_default_log_config(argv[0], &lconf);
......
......@@ -27,10 +27,13 @@ extern "C" {
#define STOP_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, false, "force", 'f', &(cmdargs).force, "Stop by force killing", NULL }, \
{ \
CMD_OPT_TYPE_CALLBACK, false, "time", 't', &(cmdargs).time, \
"Seconds to wait for stop before killing it (default 10)", command_convert_int \
}
{ CMD_OPT_TYPE_CALLBACK, \
false, \
"time", \
't', \
&(cmdargs).time, \
"Seconds to wait for stop before killing it (default 10)", \
command_convert_int },
extern const char g_cmd_stop_desc[];
extern const char g_cmd_stop_usage[];
......
......@@ -244,7 +244,7 @@ void client_arguments_free(struct client_arguments *args)
void print_common_help()
{
struct client_arguments cmd_common_args = {};
struct command_option options[] = { COMMON_OPTIONS(cmd_common_args), VERSION_OPTIONS(cmd_common_args) };
struct command_option options[] = { COMMON_OPTIONS(cmd_common_args) VERSION_OPTIONS(cmd_common_args) };
size_t len = sizeof(options) / sizeof(options[0]);
qsort(options, len, sizeof(options[0]), compare_options);
fprintf(stdout, "COMMON OPTIONS :\n");
......
......@@ -326,10 +326,7 @@ struct client_arguments {
char *key_file;
};
#define LOG_OPTIONS(log) \
{ \
CMD_OPT_TYPE_BOOL_FALSE, false, "debug", 'D', &(log).quiet, "Enable debug mode", NULL \
}
#define LOG_OPTIONS(log) { CMD_OPT_TYPE_BOOL_FALSE, false, "debug", 'D', &(log).quiet, "Enable debug mode", NULL },
#define COMMON_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_STRING_DUP, false, "host", 'H', &(cmdargs).socket, "Daemon socket(s) to connect to", \
......@@ -357,14 +354,10 @@ struct client_arguments {
&(cmdargs).key_file, \
"Path to TLS key file (default \"/root/.iSulad/key.pem\")", \
NULL }, \
{ \
CMD_OPT_TYPE_STRING, false, "help", 0, NULL, "Print usage", NULL \
}
#define VERSION_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_BOOL, false, "version", 0, NULL, "Print version information and quit", NULL \
}
{ CMD_OPT_TYPE_STRING, false, "help", 0, NULL, "Print usage", NULL },
#define VERSION_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, false, "version", 0, NULL, "Print version information and quit", NULL },
extern void print_common_help();
......
......@@ -210,8 +210,8 @@ int cmd_events_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_events_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), EVENTS_OPTIONS(g_cmd_events_args),
COMMON_OPTIONS(g_cmd_events_args)
struct command_option options[] = { LOG_OPTIONS(lconf) EVENTS_OPTIONS(g_cmd_events_args)
COMMON_OPTIONS(g_cmd_events_args)
};
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_events_desc,
......
......@@ -25,19 +25,22 @@
extern "C" {
#endif
#define EVENTS_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_STRING, false, "name", 'n', &(cmdargs).name, "Name of the container", NULL }, \
{ CMD_OPT_TYPE_STRING, \
false, \
"since", \
'S', \
&(cmdargs).since, \
"Show all events created since this timestamp", \
NULL }, \
{ \
CMD_OPT_TYPE_STRING, false, "until", 'U', &(cmdargs).until, "Show all events created until this timestamp", \
NULL \
}
#define EVENTS_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_STRING, false, "name", 'n', &(cmdargs).name, "Name of the container", NULL }, \
{ CMD_OPT_TYPE_STRING, \
false, \
"since", \
'S', \
&(cmdargs).since, \
"Show all events created since this timestamp", \
NULL }, \
{ CMD_OPT_TYPE_STRING, \
false, \
"until", \
'U', \
&(cmdargs).until, \
"Show all events created until this timestamp", \
NULL },
extern const char g_cmd_events_desc[];
extern const char g_cmd_events_usage[];
......
......@@ -93,7 +93,7 @@ int cmd_export_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_export_args.progname = argv[0];
struct command_option options[] = { COMMON_OPTIONS(g_cmd_export_args), EXPORT_OPTIONS(g_cmd_export_args) };
struct command_option options[] = { COMMON_OPTIONS(g_cmd_export_args) EXPORT_OPTIONS(g_cmd_export_args) };
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_export_desc,
g_cmd_export_usage);
......
......@@ -25,10 +25,7 @@
extern "C" {
#endif
#define EXPORT_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_STRING, false, "output", 'o', &(cmdargs).file, "Write to a file", NULL \
}
#define EXPORT_OPTIONS(cmdargs) { CMD_OPT_TYPE_STRING, false, "output", 'o', &(cmdargs).file, "Write to a file", NULL },
extern const char g_cmd_export_desc[];
extern const char g_cmd_export_usage[];
......
......@@ -220,8 +220,8 @@ int cmd_stats_main(int argc, const char **argv)
{
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), STATUS_OPTIONS(g_cmd_stats_args),
COMMON_OPTIONS(g_cmd_stats_args)
struct command_option options[] = { LOG_OPTIONS(lconf) STATUS_OPTIONS(g_cmd_stats_args)
COMMON_OPTIONS(g_cmd_stats_args)
};
if (client_arguments_init(&g_cmd_stats_args)) {
......
......@@ -25,20 +25,23 @@
extern "C" {
#endif
#define STATUS_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_BOOL, \
false, \
"all", \
'a', \
&(cmdargs).showall, \
"Show all containers (default shows just running)", \
NULL \
}, \
{ \
CMD_OPT_TYPE_BOOL, false, "no-stream", 0, &(cmdargs).nostream, \
"Disable streaming stats and only pull the first result", NULL \
}
#define STATUS_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_BOOL, \
false, \
"all", \
'a', \
&(cmdargs).showall, \
"Show all containers (default shows just running)", \
NULL \
}, \
{ CMD_OPT_TYPE_BOOL, \
false, \
"no-stream", \
0, \
&(cmdargs).nostream, \
"Disable streaming stats and only pull the first result", \
NULL },
extern const char g_cmd_stats_desc[];
extern const char g_cmd_stats_usage[];
......
......@@ -111,7 +111,7 @@ int cmd_update_main(int argc, const char **argv)
int i = 0;
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), UPDATE_OPTIONS(g_cmd_update_args),
struct command_option options[] = { LOG_OPTIONS(lconf) UPDATE_OPTIONS(g_cmd_update_args),
COMMON_OPTIONS(g_cmd_update_args)
};
......
......@@ -320,7 +320,7 @@ int cmd_images_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_images_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), IMAGES_OPTIONS(g_cmd_images_args),
struct command_option options[] = { LOG_OPTIONS(lconf) IMAGES_OPTIONS(g_cmd_images_args),
COMMON_OPTIONS(g_cmd_images_args)
};
......
......@@ -86,10 +86,7 @@ int cmd_import_main(int argc, const char **argv)
char file[PATH_MAX] = { 0 };
int exit_code = 1;
command_t cmd;
struct command_option options[] = {
LOG_OPTIONS(lconf),
COMMON_OPTIONS(g_cmd_import_args),
};
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_import_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_import_args)) {
......
......@@ -119,12 +119,9 @@ int cmd_load_main(int argc, const char **argv)
struct isula_libutils_log_config lconf = { 0 };
int exit_code = ECOMMON;
command_t cmd;
struct command_option options[] = {
LOG_OPTIONS(lconf),
COMMON_OPTIONS(g_cmd_load_args),
LOAD_OPTIONS(g_cmd_load_args),
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_load_args) LOAD_OPTIONS(g_cmd_load_args)
#ifdef ENABLE_EMBEDDED_IMAGE
EMBEDDED_OPTIONS(g_cmd_load_args),
EMBEDDED_OPTIONS(g_cmd_load_args)
#endif
};
......
......@@ -27,15 +27,16 @@ extern "C" {
#define LOAD_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_STRING, false, "input", 'i', &(cmdargs).file, "Read from a manifest or an archive", NULL }, \
{ \
CMD_OPT_TYPE_STRING, false, "tag", 0, &(cmdargs).tag, \
"Name and optionally a tag in the 'name:tag' format, valid if type is docker", NULL \
}
#define EMBEDDED_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_STRING, false, "type", 't', &(cmdargs).type, "Image type, embedded or docker(default)", NULL \
}
{ CMD_OPT_TYPE_STRING, \
false, \
"tag", \
0, \
&(cmdargs).tag, \
"Name and optionally a tag in the 'name:tag' format, valid if type is docker", \
NULL },
#define EMBEDDED_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_STRING, false, "type", 't', &(cmdargs).type, "Image type, embedded or docker(default)", NULL },
extern const char g_cmd_load_desc[];
extern struct client_arguments g_cmd_load_args;
......
......@@ -183,7 +183,7 @@ int cmd_login_main(int argc, const char **argv)
struct isula_libutils_log_config lconf = { 0 };
int exit_code = 1; /* exit 1 if failed to login */
command_t cmd;
struct command_option options[] = { COMMON_OPTIONS(g_cmd_login_args), LOGIN_OPTIONS(g_cmd_login_args) };
struct command_option options[] = { COMMON_OPTIONS(g_cmd_login_args) LOGIN_OPTIONS(g_cmd_login_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_login_args)) {
......
......@@ -82,9 +82,7 @@ int cmd_rmi_main(int argc, const char **argv)
struct isula_libutils_log_config lconf = { 0 };
int exit_code = 1; /* exit 1 if remove failed because docker return 1 */
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_rmi_args),
RMI_OPTIONS(g_cmd_rmi_args)
};
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_rmi_args) RMI_OPTIONS(g_cmd_rmi_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_rmi_args)) {
......
......@@ -25,10 +25,8 @@
extern "C" {
#endif
#define RMI_OPTIONS(cmdargs) \
{ \
CMD_OPT_TYPE_BOOL, false, "force", 'f', &(cmdargs).force, "Force removal of the image", NULL \
}
#define RMI_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, false, "force", 'f', &(cmdargs).force, "Force removal of the image", NULL },
extern const char g_cmd_rmi_desc[];
extern const char g_cmd_rmi_usage[];
......
......@@ -76,10 +76,7 @@ int cmd_tag_main(int argc, const char **argv)
struct isula_libutils_log_config lconf = { 0 };
int exit_code = 1;
command_t cmd;
struct command_option options[] = {
LOG_OPTIONS(lconf),
COMMON_OPTIONS(g_cmd_tag_args),
};
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_tag_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_tag_args)) {
......
......@@ -159,7 +159,7 @@ int cmd_info_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_info_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_info_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_info_args) };
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_info_desc,
g_cmd_info_usage);
......
......@@ -746,7 +746,7 @@ int cmd_inspect_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_inspect_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), INSPECT_OPTIONS(g_cmd_inspect_args),
struct command_option options[] = { LOG_OPTIONS(lconf) INSPECT_OPTIONS(g_cmd_inspect_args),
COMMON_OPTIONS(g_cmd_inspect_args)
};
......
......@@ -105,7 +105,7 @@ static int cmd_logs_init(int argc, const char **argv)
return ECOMMON;
}
g_cmd_logs_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), LOGS_OPTIONS(g_cmd_logs_args),
struct command_option options[] = { LOG_OPTIONS(lconf) LOGS_OPTIONS(g_cmd_logs_args),
COMMON_OPTIONS(g_cmd_logs_args)
};
......
......@@ -65,8 +65,8 @@ struct lengths {
};
const char * const g_containerstatusstr[] = { "unknown", "inited", "starting", "running",
"exited", "paused", "restarting"
};
"exited", "paused", "restarting"
};
struct filter_field {
char *name;
......@@ -983,7 +983,7 @@ int cmd_list_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_list_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), LIST_OPTIONS(g_cmd_list_args),
struct command_option options[] = { LOG_OPTIONS(lconf) LIST_OPTIONS(g_cmd_list_args),
COMMON_OPTIONS(g_cmd_list_args)
};
......
......@@ -119,7 +119,7 @@ int cmd_top_main(int argc, const char **argv)
{
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_top_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_top_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_top_args)) {
......
......@@ -97,7 +97,7 @@ int cmd_version_main(int argc, const char **argv)
{
struct isula_libutils_log_config lconf = { 0 };
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_version_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_version_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_version_args)) {
......
......@@ -89,7 +89,7 @@ int cmd_wait_main(int argc, const char **argv)
int i = 0;
int status = 0;
command_t cmd;
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_wait_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_wait_args) };
isula_libutils_default_log_config(argv[0], &lconf);
if (client_arguments_init(&g_cmd_wait_args)) {
......
......@@ -171,7 +171,7 @@ static int attach_cmd_init(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_attach_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_attach_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_attach_args) };
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_attach_desc,
g_cmd_attach_usage);
......
......@@ -17,7 +17,6 @@
#include "client_arguments.h"
#include "isula_libutils/container_inspect.h"
#include "wait.h"
extern const char g_cmd_attach_desc[];
extern const char g_cmd_attach_usage[];
......
......@@ -324,7 +324,7 @@ int cmd_cp_main(int argc, const char **argv)
exit(ECOMMON);
}
g_cmd_cp_args.progname = argv[0];
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_cp_args) };
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_cp_args) };
command_init(&cmd, options, sizeof(options) / sizeof(options[0]), argc, (const char **)argv, g_cmd_cp_desc,
g_cmd_cp_usage);
......
......@@ -156,8 +156,8 @@ static int exec_cmd_init(int argc, const char **argv)
command_t cmd;
struct isula_libutils_log_config lconf = { 0 };
struct command_option options[] = { LOG_OPTIONS(lconf), COMMON_OPTIONS(g_cmd_exec_args),
EXEC_OPTIONS(g_cmd_exec_args)
struct command_option options[] = { LOG_OPTIONS(lconf) COMMON_OPTIONS(g_cmd_exec_args)
EXEC_OPTIONS(g_cmd_exec_args)
};
isula_libutils_default_log_config(argv[0], &lconf);
......
......@@ -36,10 +36,13 @@
&(cmdargs).custom_conf.open_stdin, \
"Keep STDIN open even if not attached", \
NULL }, \
{ \
CMD_OPT_TYPE_STRING_DUP, false, "user", 'u', &(cmdargs).custom_conf.user, \
"Username or UID (format: <name|uid>[:<group|gid>])", NULL \
}
{ CMD_OPT_TYPE_STRING_DUP, \
false, \
"user", \
'u', \
&(cmdargs).custom_conf.user, \
"Username or UID (format: <name|uid>[:<group|gid>])", \
NULL },
extern const char g_cmd_exec_desc[];
extern const char g_cmd_exec_usage[];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册