diff --git a/src/build-manifest.ts b/src/build-manifest.ts index ec32f417..6563abfe 100644 --- a/src/build-manifest.ts +++ b/src/build-manifest.ts @@ -173,6 +173,7 @@ function scanYaml(filePath: string, site: string): ManifestEntry | null { type: argDef?.type ?? 'str', default: argDef?.default, required: argDef?.required ?? false, + positional: argDef?.positional === true || undefined, help: argDef?.description ?? argDef?.help ?? '', choices: argDef?.choices, }); diff --git a/src/clis/xueqiu/earnings-date.yaml b/src/clis/xueqiu/earnings-date.yaml index 4afef8ae..e2147fe3 100644 --- a/src/clis/xueqiu/earnings-date.yaml +++ b/src/clis/xueqiu/earnings-date.yaml @@ -6,7 +6,9 @@ browser: true args: symbol: + positional: true type: str + required: true description: 股票代码,如 SH600519、SZ000858、00700 next: type: bool diff --git a/src/clis/xueqiu/search.yaml b/src/clis/xueqiu/search.yaml index ed7ab76c..b33974e2 100644 --- a/src/clis/xueqiu/search.yaml +++ b/src/clis/xueqiu/search.yaml @@ -6,7 +6,9 @@ browser: true args: query: + positional: true type: str + required: true description: 搜索关键词,如 茅台、AAPL、腾讯 limit: type: int @@ -19,7 +21,6 @@ pipeline: (async () => { const query = ${{ args.query | json }}; const count = ${{ args.limit }}; - if (!query) throw new Error('Missing argument: query'); const resp = await fetch(`https://xueqiu.com/stock/search.json?code=${encodeURIComponent(query)}&size=${count}`, {credentials: 'include'}); if (!resp.ok) throw new Error('HTTP ' + resp.status + ' Hint: Not logged in?'); const d = await resp.json(); diff --git a/src/clis/xueqiu/stock.yaml b/src/clis/xueqiu/stock.yaml index 45d09e4e..ab5f5791 100644 --- a/src/clis/xueqiu/stock.yaml +++ b/src/clis/xueqiu/stock.yaml @@ -6,7 +6,9 @@ browser: true args: symbol: + positional: true type: str + required: true description: 股票代码,如 SH600519、SZ000858、AAPL、00700 pipeline: