Fluent text input: positional args, short flags, and stdin
Merged
JE
8mo ago+395+395+012345678901234567890123456789-24-24-01234567890123456789
Summary
todo addaccepts positional title,-tshorthand, and stdin (in addition to existing--title)journal writeaccepts positional content with date/content disambiguation,-cshorthand (in addition to existing--contentand stdin/$EDITOR)- Flag and positional are mutually exclusive with clear error messages
- Resolution order: named flag > positional arg > stdin > $EDITOR
# Before
hey todo add --title "Buy milk"
hey journal write --content "Today was great"
# After (flag forms still work)
hey todo add "Buy milk"
hey journal write "Today was great"
hey journal write 2024-01-15 "Retrospective"
echo "Buy milk" | hey todo add
Cross-CLI conventions documented in basecamp/cli@6f99340 (INPUT-CONVENTIONS.md).
Test plan
-
go test ./internal/cmd/ -run TestTodoAdd -v— 6 tests (positional, short flag, long flag, conflict, empty, stdin) -
go test ./internal/cmd/ -run TestJournalWrite -v— 5 tests (positional content, date+content, short flag, two conflict cases) -
go test ./internal/cmd/ -run TestSurface -v— surface unchanged -
make check— full suite passes (go vet+ all tests; lint deferred to CI due to local toolchain mismatch)