Skip to content

Commit

Permalink
Merge pull request #7659 from filecoin-project/fix/docgen-cli-nodesc
Browse files Browse the repository at this point in the history
docsgen-cli: Handle commands with no description correctly
  • Loading branch information
magik6k authored Nov 22, 2021
2 parents 51753a1 + 699d2c7 commit 6c0374c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
12 changes: 11 additions & 1 deletion documentation/en/cli-lotus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions scripts/generate-lotus-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ def get_cmd_recursively(cur_cmd):
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))
Expand Down

0 comments on commit 6c0374c

Please sign in to comment.