提交 49984209 编写于 作者: H handyohos

Add begetctl to reduce commands

Signed-off-by: Nhandyohos <zhangxiaotian@huawei.com>
Change-Id: I7de63375de1c7d285a37915caed4cee48d1d1a25
上级 2eaeba40
......@@ -61,7 +61,8 @@ static int main_cmd(int argc, char* argv[])
return 0;
}
MODULE_CONSTRUCTOR() {
MODULE_CONSTRUCTOR()
{
(void)BegetCtlCmdAdd("reboot", main_cmd);
(void)BegetCtlCmdAdd("devctl", main_cmd);
}
......@@ -26,7 +26,8 @@ struct CMD_LIST_ST {
static struct CMD_LIST_ST *m_cmdList = NULL;
int BegetCtlCmdAdd(const char *name, BegetCtlCmdPtr cmd) {
int BegetCtlCmdAdd(const char *name, BegetCtlCmdPtr cmd)
{
struct CMD_LIST_ST *item;
if (name == NULL) {
......@@ -51,7 +52,8 @@ int BegetCtlCmdAdd(const char *name, BegetCtlCmdPtr cmd) {
return 0;
}
static const struct CMD_LIST_ST *BegetCtlCmdFind(const char *name) {
static const struct CMD_LIST_ST *BegetCtlCmdFind(const char *name)
{
const struct CMD_LIST_ST *item = m_cmdList;
while (item != NULL) {
......@@ -63,7 +65,8 @@ static const struct CMD_LIST_ST *BegetCtlCmdFind(const char *name) {
return NULL;
}
static void BegetCtlUsage(const char *command) {
static void BegetCtlUsage(const char *command)
{
const struct CMD_LIST_ST *item = m_cmdList;
int notFirst = 0;
......@@ -78,7 +81,8 @@ static void BegetCtlUsage(const char *command) {
printf("\n");
}
int main(int argc, char **argv) {
int main(int argc, char **argv)
{
const struct CMD_LIST_ST *cmd;
const char *last = strrchr(argv[0], '/');
......
......@@ -244,6 +244,7 @@ static int main_cmd(int argc, char **argv)
return 0;
}
MODULE_CONSTRUCTOR() {
MODULE_CONSTRUCTOR()
{
(void)BegetCtlCmdAdd("misc_deamon", main_cmd);
}
......@@ -191,7 +191,8 @@ static int main_cmd(int argc, char *argv[])
return RunParamCommand(argc, argv);
}
MODULE_CONSTRUCTOR() {
MODULE_CONSTRUCTOR()
{
(void)BegetCtlCmdAdd("param", main_cmd);
}
#endif
......@@ -92,7 +92,8 @@ static int main_cmd(int argc, char** argv)
return 0;
}
MODULE_CONSTRUCTOR() {
MODULE_CONSTRUCTOR()
{
(void)BegetCtlCmdAdd("service", main_cmd);
(void)BegetCtlCmdAdd("service_control", main_cmd);
(void)BegetCtlCmdAdd("start_service", main_cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册