Skip to content

fix: fish下参数解析问题#548

Open
expecer wants to merge 1 commit into
nelvko:masterfrom
expecer:fix/fish-help
Open

fix: fish下参数解析问题#548
expecer wants to merge 1 commit into
nelvko:masterfrom
expecer:fix/fish-help

Conversation

@expecer

@expecer expecer commented Apr 25, 2026

Copy link
Copy Markdown

变更说明

修复 fish 环境下 clashctl 的参数分发问题。

当前 scripts/cmd/clashctl.fish 中,clashctl 会把第一个参数直接拼接成
clash"$suffix",这会导致参数解析失败。在我的使用中,clashctl --help 被错误解析成 clash--help,显示错误

修改内容

  • 补齐 fish 包装层中对各个子命令的显式分发
  • 增加 -h / --help 的处理
  • fish 下的行为与 bash 版本保持一致

复现方式

修复前:

clashctl --help
clashctl -h
clashctl foo

会报类似下面的错误:

fish: 未知的命令:clash--help

备注

这个问题我是在本机 fish 环境中复现并验证的,修复后已确认相关命令行为正常。第一次提交pr, 如果提交有问题就和我说说吧

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant