Repository navigation
MARSOHS-2747: accept --local-file on harness-runtime download - #2115
nveerdixit wants to merge 6 commits into
Conversation
upload names the local path --local-file while download names it --save-to, so the symmetric guess failed with "unknown flag". download now accepts --local-file as a second spelling of --save-to through the flag set's normalize function, the same way --file is accepted for --spec. --save-to stays canonical in help and keeps its required check; the help text mentions the alias. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sanpj2292
left a comment
There was a problem hiding this comment.
LGTM. One non-blocking nit:
acceptFlagAliascallsSetNormalizeFunc, and a command has only one normalize function, so a second call on the same command silently replaces the first alias. That's safe today, becausedownloadhas no other alias, and the doc comment says so. If a second alias is ever needed, a small map-based version (alias → canonical) would avoid the trap.
|
please resolve the merge conflicts |
A flag set has one normalize function, so a second acceptFlagAlias call on the same command replaced the first alias. Wrap the previous function instead, so a command can take several aliases. Co-authored-by: Cursor <cursoragent@cursor.com>
a671bbe
|
Merged @sanpj2292 I took the nit in a671bbe.
|
…-local-file Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # commands/agents_test.go
|
|
|
@nveerdixit please resolve the merge conflicts |
…-local-file Co-authored-by: Cursor <cursoragent@cursor.com>
|
@SSharma-10 Resolved. I merged current |

Summary
doctl harness-runtime uploadnames the local path--local-file.downloadnamed the same thing--save-to. A user who had just runupload --local-file ./x.txtnaturally trieddownload --local-file ./x.txtand gotError: unknown flag: --local-file.downloadnow accepts--local-fileas a second spelling of--save-to:How
--filealias for--spec: the command's flag normalize function mapslocal-filetosave-to. No new flag is registered.--save-tostays the name in help output and in the missing-flag error, so existing scripts and docs stay correct.acceptFlagAlias(cmd, alias, canonical).acceptFileAliasForcalls it, with unchanged behaviour.--local-filealso works.Notes
--spec/--file.upload,doctl microvm upload/download(same pair of names, different command group) and the in-chat/downloadcommand.Testing
TestAgentsDownload_LocalFileIsAliasForSaveToparses the realdownloadcommand and checks four things:--local-fileand--save-toeach reach the valueRunAgentsDownloadreads.--save-tostays the canonical flag name.save-to.I also confirmed that swapping the helper's two arguments makes the test fail.
go test ./commands/ ./do/passes exceptTestRegistryLogout, which also fails on unmodifiedmainin my environment (it needs the OS keychain).Refs: MARSOHS-2747
🤖 Generated with Claude Code