diff --git a/service/devicedebug/devicedebug_main.c b/service/devicedebug/devicedebug_main.c index 5aa22a9c..72e64497 100644 --- a/service/devicedebug/devicedebug_main.c +++ b/service/devicedebug/devicedebug_main.c @@ -38,7 +38,7 @@ APPSPAWN_STATIC int DeviceDebugShowHelp(int argc, char *argv[]) printf("\r\nusage: devicedebug \r\n" "\r\nThese are common devicedebug commands list:\r\n" "\r\n help list available commands" - "\r\n kill send a signal to a process\r\n"); + "\r\n kill send a signal(1-64) to a process\r\n"); return 0; } @@ -76,7 +76,9 @@ int main(int argc, char *argv[]) /* 检验用户命令,获取对应的处理函数 */ cmdInfo = DeviceDebugCmdCheck(argv[DEVICEDEBUG_NUM_1]); if (cmdInfo == NULL) { - DEVICEDEBUG_LOGE("invalid cmd!. cmd:%{public}s\r\n", argv[DEVICEDEBUG_NUM_1]); + printf("devicedebug: '%s' is not a valid devicedebug command. See 'devicedebug help'.", + argv[DEVICEDEBUG_NUM_1]); + DeviceDebugShowHelp(argc, argv); return DEVICEDEBUG_ERRNO_OPERATOR_TYPE_INVALID; } diff --git a/service/devicedebug/kill/src/devicedebug_kill.c b/service/devicedebug/kill/src/devicedebug_kill.c index f36c177f..08be2ee9 100644 --- a/service/devicedebug/kill/src/devicedebug_kill.c +++ b/service/devicedebug/kill/src/devicedebug_kill.c @@ -36,7 +36,7 @@ APPSPAWN_STATIC void DeviceDebugShowKillHelp(void) printf("\r\nusage: devicedebug kill [options] " "\r\noptions list:" "\r\n -h, --help list available commands" - "\r\n kill - send a signal to a process\r\n"); + "\r\n kill - send a signal(1-64) to a process\r\n"); } APPSPAWN_STATIC char* DeviceDebugJsonStringGeneral(int pid, const char *op, cJSON *args) @@ -133,7 +133,7 @@ int DeviceDebugCmdKill(int argc, char *argv[]) int signal = atoi(argv[DEVICEDEBUG_KILL_CMD_SIGNAL_INDEX] + 1); if (signal > SIGRTMAX || signal <= 0) { - DEVICEDEBUG_LOGE("signal is %{public}d > %{public}d", signal, SIGRTMAX); + DEVICEDEBUG_LOGE("signal is %{public}d not in [1, %{public}d]", signal, SIGRTMAX); DeviceDebugShowKillHelp(); return DEVICEDEBUG_ERRNO_PARAM_INVALID; }