Reject conflicting CLI operation modes
还没有人认领这个 Issue。
评估
调研方向
从 main.go 中的 flag 声明和模式选择 switch 开始,issue 中直接链接了这里。通过检查 switch 并使用如 -scrape -upload -map 这样的冲突组合来复现,无需执行真实请求。完成标准是:任何同时包含多个 -scrape、-parse 和 -upload 的命令,都会在开始任何工作之前打印清晰的提示并以非零状态退出,而单一模式命令和未指定模式时的帮助输出保持原有行为。
由索引模型根据 Issue 内容生成。
描述
Description
The CLI accepts multiple operation modes (-scrape, -parse, and -upload) at once. The switch in main.go silently chooses the first matching mode instead of reporting an invalid combination.
For example, -scrape -upload -map starts scraping even though the command requests both scraping and uploading.
Expected behavior:
- Reject any combination containing more than one operation mode with a clear message explaining that only one mode may be selected.
- Exit with a nonzero status before starting scraping, parsing, or uploading.
- Preserve valid single-mode commands and the existing help behavior when no mode is supplied.
Steps To Reproduce
- Build the executable with
make build(orbuild.bat buildon Windows). - Run:
./api-tools -scrape -upload -map - Observe that the CLI selects scraping instead of rejecting the conflicting modes.
The same problem applies to -scrape -parse, -parse -upload, and all three mode flags together. The example above performs a real map scrape; inspecting the mode-selection switch also demonstrates the problem without making requests.
Additional Context
Flag declarations and mode-selection switch in main.go.
Environment
- 主要语言
- Go
- 星标
- 12
- 派生
- 54
- 平均合并
- 14 天 1 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
UTDNebula/api-tools 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
-
Improve unit tests in sectionParser_test.go可能已有人在做 @Sidd-Pelluru 于 42 天前认领。 未关闭L1 recommended for recruits
难度 2/5 1-3 小时 新手友好度 88/100
-
Improve unit tests in discountsParser_test.go可能重新可做 @LikithInam 于 28 天前认领,目前没有进行中的 PR。 未关闭L1 recommended for recruits
难度 2/5 1-3 小时 新手友好度 88/100
-
L1 recommended for recruits
难度 2/5 1-3 小时 新手友好度 85/100
-
Comet Calendar events with multiple locations可能已有人在做 @azythromycin 于 22 天前认领。 未关闭L1 Type: Bug Report
难度 2/5 1-3 小时 新手友好度 76/100
查看 UTDNebula/api-tools 的全部 Issue
相似的 Issue
-
Query cache: a failed cache page read leaves the set request's read lock held, so the scan hangs未关闭
难度 2/5 1-3 小时 新手友好度 78/100
turbot/steampipe-plugin-sdk#986 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
router-for-me/CLIProxyAPI#7307 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
betterleaks/betterleaks#460 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
openmcp-project/service-provider-crossplane#330 ·
维护者通常 1 天内回复