Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions nb_cli/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ def __call__(self, x: Adapter | Plugin | Driver, *, value: str) -> bool: ...
(v.lower() in (t.label.lower() for t in x.tags))
for v in value.strip().split(",")
),
"type:": lambda x, *, value: not value.strip()
or not isinstance(x, Plugin)
or value.strip() in "unknown"
or (x.type is not None and value.strip() in x.type),
}


Expand Down
1 change: 1 addition & 0 deletions nb_cli/config/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class Plugin(PackageInfo):
author: str
homepage: str
tags: list[Tag]
type: str | None = None
is_official: bool | None = None
valid: bool | None = None
skip_test: bool = False
Expand Down
6 changes: 5 additions & 1 deletion website/docs/guide/advanced-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ NB-CLI 提供了一套高级搜索的支持,便于用户检索商店内容。
- `#passing`:仅显示通过校验的插件
- `#tag:标签名`:按标签筛选(逗号分隔多个标签)
- `#author:作者名`:按作者筛选(逗号分隔多个作者)
- `#type:插件类型`:按插件类型筛选(`application`、`library` 或 `unknown`)

示例:

Expand All @@ -55,6 +56,8 @@ NB-CLI 提供了一套高级搜索的支持,便于用户检索商店内容。
- `!official`:排除官方项目
- `!tag:xxx`:排除指定标签
- `!author:xxx`:排除指定作者
- `!passing`:排除通过校验的插件
- `!type:xxx`:排除指定类型的插件

示例:

Expand All @@ -67,7 +70,7 @@ NB-CLI 提供了一套高级搜索的支持,便于用户检索商店内容。
可将关键词、`-` 前缀、`#`/`!` 前缀、带参数 filter 混合使用,支持分号分隔多组条件:

```
工具 -测试 #official !tag:娱乐; 管理 #tag:管理
工具 -测试 #official !tag:游戏; 管理 #tag:管理
```

### 交互行为说明
Expand All @@ -76,3 +79,4 @@ NB-CLI 提供了一套高级搜索的支持,便于用户检索商店内容。
- `!filter`:排除 filter 作用范围内的项目
- `#filter`:仅保留 filter 作用范围内的项目
- `tag:`、`author:` 可用逗号分隔多个值
- `type:` 支持部分匹配,如 `app` 匹配 `application`,`lib` 匹配 `library` 等