LU-16723 parser: fix help hanging
Running a command such as 'lctl pcc help v' will
hang indefinitely. This is due to a bug in find_cmd,
return pointers from two different arrays.
This is fixed by setting top_level to be the
concatenation of the override_cmdlist and the
regular cmds.
Also, rather than recursing forever, give up after
reaching an arbitrary depth.
Improve several help messages so that users will
have a better idea why their commands aren't
working.
Fixes:
21080400f9 ("LU-16723 libcfs: refactor parser to be simpler")
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Ib22bc71e5952b1beb868bbe37bc8f6b08c94ff72
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51339
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>