[v0.1/CLI Args Review] Expose the finite --format/--source vocabularies to clap #184
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis#184
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
現状
--formatとcapture --sourceは有限語彙なのに、clap へvalue_parser = fnで渡しているため、possible values が help と generated completion のどちらにも現れない。#55 で指摘済みだが子 issue がなく、追跡されていない。実機確認 (
felis sessions capture --help):--format <FORMAT>—[possible values: …]なし。本文に`human` (default) or `jsonl`と書くのみ。--source <SOURCE>— 同上。visible/scrollback/command-output/last-commandは本文のみ。該当 parser:
crates/felis-cli/src/cli_output.rs—parse_point_format(human/json)、parse_stream_format(human/jsonl)crates/felis-cli/src/cli_sessions.rs:469—parse_region_source(visible/scrollback/command-output/last-command)completions <shell>は clap_complete 経由で生成されるが、fn parser の値域は補完候補に出ない (fish/zsh overlay が足すのは session id のみ)。--keyの chord 文法やKEY=VAL、ID-OR-PREFIXは無限文法なので対象外。completions <shell>の shell 名はclap_complete::Shell(ValueEnum) で公開済み。提案
有限語彙の 2 flag を
PossibleValuesParser/ValueEnum化し、語彙を clap に公開する。2の usage error。ただし現行の親切な文言 (例:`jsonl` frames a stream; …) は clap 既定の invalid-value error に変わる。これは pre-publish の破壊的変更として許容し、CHANGELOG.mdUnreleased に記す。文言を残す安価な手段があれば残すが、必須としない。felis completions bash|zsh|fishの生成物に当該値が現れることを golden で固定する。Principle check
Acceptance criteria
sessions capture --help等の--format/--sourceに[possible values: …]が現れる。--format jsonlon point verb、--source bogus) が exit2であることがテストされる。docs/reference/cli.mdが error 文言を引用している箇所があれば新文言に同期する。CHANGELOG.mdに pre-publish break として記す。対象
crates/felis-cli/src/cli_output.rs(PointFormat,StreamFormat, parser 2 関数)crates/felis-cli/src/cli_sessions.rs(parse_region_sourceと使用箇所)crates/felis-cli/src/tests.rs(help/completion golden)docs/reference/cli.md、CHANGELOG.mdParent review: #55. Release tracker: #12.
sourceandattachmentstrings the runtime rejects, so schema-valid requests can still fail as malformed #178Merged into #187, which carries the same change (ValueEnums for
--formatandcapture --source, possible values in help, completion golden, exit 2 on a bad value, CHANGELOG entry) and is being implemented on branchfeat/finite-option-values-187. Closing as a duplicate; #187 reports back to #55.