Skip to content

Commit

Permalink
✨ show exists parts for node help
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Aug 31, 2024
1 parent 75196c3 commit f324d71
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 69 deletions.
4 changes: 2 additions & 2 deletions README-EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ from arclet.alconna import Alconna, Option, Subcommand, Args

cmd = Alconna(
"/pip",
Subcommand("install", Option("-u|--upgrade"), Args.pak_name[str]),
Subcommand("install", Option("-U|--upgrade"), Args["pak", str]),
Option("list")
)

Expand All @@ -51,7 +51,7 @@ print(result.query('install')) # Or result.install

Output as follows:
```
value=None args={'pak_name': 'numpy'} options={'upgrade': value=Ellipsis args={}} subcommands={}
value=None args={'pak': 'numpy'} options={'upgrade': value=Ellipsis args={}} subcommands={}
```

## Communication
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ from arclet.alconna import Alconna, Option, Subcommand, Args

cmd = Alconna(
"/pip",
Subcommand("install", Option("-u|--upgrade"), Args.pak_name[str]),
Subcommand("install", Option("-U|--upgrade"), Args["pak", str]),
Option("list")
)

result = cmd.parse("/pip install numpy --upgrade") # 该方法返回一个Arpamar类的实例
result = cmd.parse("/pip install numpy --upgrade") # 该方法返回一个Arparma类的实例
print(result.query('install')) # 或者 result.install
```
其结果为
```
value=None args={'pak_name': 'numpy'} options={'upgrade': value=Ellipsis args={}} subcommands={}
value=None args={'pak': 'numpy'} options={'upgrade': value=Ellipsis args={}} subcommands={}
```

## 讨论
Expand Down
117 changes: 63 additions & 54 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f324d71

Please sign in to comment.