Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
fc23bef7
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fc23bef7
编写于
7月 06, 2020
作者:
L
lifeng68
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean code:remove unused head file
Signed-off-by:
N
lifeng68
<
lifeng68@huawei.com
>
上级
d2ea15de
变更
43
隐藏空白更改
内联
并排
Showing
43 changed file
with
162 addition
and
156 deletion
+162
-156
src/cmd/isula/base/create.c
src/cmd/isula/base/create.c
+2
-2
src/cmd/isula/base/create.h
src/cmd/isula/base/create.h
+10
-9
src/cmd/isula/base/kill.c
src/cmd/isula/base/kill.c
+2
-2
src/cmd/isula/base/kill.h
src/cmd/isula/base/kill.h
+8
-6
src/cmd/isula/base/rename.c
src/cmd/isula/base/rename.c
+1
-1
src/cmd/isula/base/restart.c
src/cmd/isula/base/restart.c
+2
-2
src/cmd/isula/base/restart.h
src/cmd/isula/base/restart.h
+8
-4
src/cmd/isula/base/rm.c
src/cmd/isula/base/rm.c
+2
-2
src/cmd/isula/base/rm.h
src/cmd/isula/base/rm.h
+15
-12
src/cmd/isula/base/run.c
src/cmd/isula/base/run.c
+2
-3
src/cmd/isula/base/run.h
src/cmd/isula/base/run.h
+15
-7
src/cmd/isula/base/start.c
src/cmd/isula/base/start.c
+1
-1
src/cmd/isula/base/stop.c
src/cmd/isula/base/stop.c
+2
-2
src/cmd/isula/base/stop.h
src/cmd/isula/base/stop.h
+7
-4
src/cmd/isula/client_arguments.c
src/cmd/isula/client_arguments.c
+1
-1
src/cmd/isula/client_arguments.h
src/cmd/isula/client_arguments.h
+5
-12
src/cmd/isula/extend/events.c
src/cmd/isula/extend/events.c
+2
-2
src/cmd/isula/extend/events.h
src/cmd/isula/extend/events.h
+16
-13
src/cmd/isula/extend/export.c
src/cmd/isula/extend/export.c
+1
-1
src/cmd/isula/extend/export.h
src/cmd/isula/extend/export.h
+1
-4
src/cmd/isula/extend/stats.c
src/cmd/isula/extend/stats.c
+2
-2
src/cmd/isula/extend/stats.h
src/cmd/isula/extend/stats.h
+17
-14
src/cmd/isula/extend/update.c
src/cmd/isula/extend/update.c
+1
-1
src/cmd/isula/images/images.c
src/cmd/isula/images/images.c
+1
-1
src/cmd/isula/images/import.c
src/cmd/isula/images/import.c
+1
-4
src/cmd/isula/images/load.c
src/cmd/isula/images/load.c
+2
-5
src/cmd/isula/images/load.h
src/cmd/isula/images/load.h
+10
-9
src/cmd/isula/images/login.c
src/cmd/isula/images/login.c
+1
-1
src/cmd/isula/images/rmi.c
src/cmd/isula/images/rmi.c
+1
-3
src/cmd/isula/images/rmi.h
src/cmd/isula/images/rmi.h
+2
-4
src/cmd/isula/images/tag.c
src/cmd/isula/images/tag.c
+1
-4
src/cmd/isula/information/info.c
src/cmd/isula/information/info.c
+1
-1
src/cmd/isula/information/inspect.c
src/cmd/isula/information/inspect.c
+1
-1
src/cmd/isula/information/logs.c
src/cmd/isula/information/logs.c
+1
-1
src/cmd/isula/information/ps.c
src/cmd/isula/information/ps.c
+3
-3
src/cmd/isula/information/top.c
src/cmd/isula/information/top.c
+1
-1
src/cmd/isula/information/version.c
src/cmd/isula/information/version.c
+1
-1
src/cmd/isula/information/wait.c
src/cmd/isula/information/wait.c
+1
-1
src/cmd/isula/stream/attach.c
src/cmd/isula/stream/attach.c
+1
-1
src/cmd/isula/stream/attach.h
src/cmd/isula/stream/attach.h
+0
-1
src/cmd/isula/stream/cp.c
src/cmd/isula/stream/cp.c
+1
-1
src/cmd/isula/stream/exec.c
src/cmd/isula/stream/exec.c
+2
-2
src/cmd/isula/stream/exec.h
src/cmd/isula/stream/exec.h
+7
-4
未找到文件。
src/cmd/isula/base/create.c
浏览文件 @
fc23bef7
...
...
@@ -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
,
...
...
src/cmd/isula/base/create.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/base/kill.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/base/kill.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/base/rename.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/base/restart.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/base/restart.h
浏览文件 @
fc23bef7
...
...
@@ -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 */
src/cmd/isula/base/rm.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/base/rm.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/base/run.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/base/run.h
浏览文件 @
fc23bef7
...
...
@@ -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 */
src/cmd/isula/base/start.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/base/stop.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/base/stop.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/client_arguments.c
浏览文件 @
fc23bef7
...
...
@@ -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
"
);
...
...
src/cmd/isula/client_arguments.h
浏览文件 @
fc23bef7
...
...
@@ -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
();
...
...
src/cmd/isula/extend/events.c
浏览文件 @
fc23bef7
...
...
@@ -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
,
...
...
src/cmd/isula/extend/events.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/extend/export.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/extend/export.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/extend/stats.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/extend/stats.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/extend/update.c
浏览文件 @
fc23bef7
...
...
@@ -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
)
};
...
...
src/cmd/isula/images/images.c
浏览文件 @
fc23bef7
...
...
@@ -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
)
};
...
...
src/cmd/isula/images/import.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/images/load.c
浏览文件 @
fc23bef7
...
...
@@ -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
};
...
...
src/cmd/isula/images/load.h
浏览文件 @
fc23bef7
...
...
@@ -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
;
...
...
src/cmd/isula/images/login.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/images/rmi.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/images/rmi.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/images/tag.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/information/info.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/information/inspect.c
浏览文件 @
fc23bef7
...
...
@@ -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
)
};
...
...
src/cmd/isula/information/logs.c
浏览文件 @
fc23bef7
...
...
@@ -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
)
};
...
...
src/cmd/isula/information/ps.c
浏览文件 @
fc23bef7
...
...
@@ -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
)
};
...
...
src/cmd/isula/information/top.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/information/version.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/information/wait.c
浏览文件 @
fc23bef7
...
...
@@ -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
))
{
...
...
src/cmd/isula/stream/attach.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/stream/attach.h
浏览文件 @
fc23bef7
...
...
@@ -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
[];
...
...
src/cmd/isula/stream/cp.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/stream/exec.c
浏览文件 @
fc23bef7
...
...
@@ -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
);
...
...
src/cmd/isula/stream/exec.h
浏览文件 @
fc23bef7
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录