From 6a7638599ca0d23d5e40f7a36a13d8be3e47543a Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 24 Sep 2015 17:22:50 +0800 Subject: [PATCH] [finsh] Add more option for ps command --- components/finsh/msh_cmd.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c index 44c3d8fd8..fc6b56cdd 100644 --- a/components/finsh/msh_cmd.c +++ b/components/finsh/msh_cmd.c @@ -242,6 +242,11 @@ int cmd_mkfs(int argc, char** argv) rt_kprintf("Usage: mkfs [-t type] device\n"); return 0; } + + if (result != RT_EOK) + { + rt_kprintf("mkfs failed, result=%d\n", result); + } return 0; } @@ -292,8 +297,14 @@ FINSH_FUNCTION_EXPORT_ALIAS(cmd_netstat, __cmd_netstat, list the information of int cmd_ps(int argc, char** argv) { extern long list_thread(void); - - list_thread(); + extern int list_module(void); + +#ifdef RT_USING_MODULE + if ((argc == 2) && (strcmp(argv[1], "-m") == 0)) + list_module(); + else +#endif + list_thread(); return 0; } FINSH_FUNCTION_EXPORT_ALIAS(cmd_ps, __cmd_ps, List threads in the system.);