docsgen-cli: Handle commands with no description correctly
This commit is contained in:
parent
81a2f2f06d
commit
699d2c7b24
@ -1595,8 +1595,18 @@ OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
# nage
|
||||
|
||||
### lotus mpool manage
|
||||
```
|
||||
NAME:
|
||||
lotus mpool manage -
|
||||
|
||||
USAGE:
|
||||
lotus mpool manage [command options] [arguments...]
|
||||
|
||||
OPTIONS:
|
||||
--help, -h show help (default: false)
|
||||
|
||||
```
|
||||
|
||||
## lotus state
|
||||
|
@ -31,12 +31,11 @@ def generate_lotus_cli(prog):
|
||||
if cmd_flag is True and line == '':
|
||||
cmd_flag = False
|
||||
if cmd_flag is True and line[-1] != ':' and 'help, h' not in line:
|
||||
gap_pos = 0
|
||||
gap_pos = None
|
||||
sub_cmd = line
|
||||
if ' ' in line:
|
||||
gap_pos = sub_cmd.index(' ')
|
||||
if gap_pos:
|
||||
sub_cmd = cur_cmd + ' ' + sub_cmd[:gap_pos]
|
||||
sub_cmd = cur_cmd + ' ' + sub_cmd[:gap_pos]
|
||||
get_cmd_recursively(sub_cmd)
|
||||
except Exception as e:
|
||||
print('Fail to deal with "%s" with error:\n%s' % (line, e))
|
||||
|
Loading…
Reference in New Issue
Block a user