Skip to content

Commit 73863c9

Browse files
authored
Rename --chat flag to --room (#321)
* Rename --chat flag to --room Basecamp's UI calls them "Campfire rooms" but the CLI used the internal name "chat" for the flag. Rename to --room/-r to align with product language. Update all breadcrumbs, annotations, tests, and e2e coverage. Add e2e regression test proving --chat is now rejected and a unit test exercising the -r shorthand. * Update surface snapshot for --chat to --room rename Regenerate .surface with --room entries replacing --chat. Acknowledge the seven removed --chat FLAG lines in .surface-breaking.
1 parent 45ce262 commit 73863c9

9 files changed

Lines changed: 105 additions & 66 deletions

File tree

.surface

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,6 @@ FLAG basecamp cards update --verbose type=count
15551555
FLAG basecamp chat --account type=string
15561556
FLAG basecamp chat --agent type=bool
15571557
FLAG basecamp chat --cache-dir type=string
1558-
FLAG basecamp chat --chat type=string
15591558
FLAG basecamp chat --count type=bool
15601559
FLAG basecamp chat --hints type=bool
15611560
FLAG basecamp chat --ids-only type=bool
@@ -1569,14 +1568,14 @@ FLAG basecamp chat --no-stats type=bool
15691568
FLAG basecamp chat --profile type=string
15701569
FLAG basecamp chat --project type=string
15711570
FLAG basecamp chat --quiet type=bool
1571+
FLAG basecamp chat --room type=string
15721572
FLAG basecamp chat --stats type=bool
15731573
FLAG basecamp chat --styled type=bool
15741574
FLAG basecamp chat --todolist type=string
15751575
FLAG basecamp chat --verbose type=count
15761576
FLAG basecamp chat delete --account type=string
15771577
FLAG basecamp chat delete --agent type=bool
15781578
FLAG basecamp chat delete --cache-dir type=string
1579-
FLAG basecamp chat delete --chat type=string
15801579
FLAG basecamp chat delete --count type=bool
15811580
FLAG basecamp chat delete --force type=bool
15821581
FLAG basecamp chat delete --hints type=bool
@@ -1591,14 +1590,14 @@ FLAG basecamp chat delete --no-stats type=bool
15911590
FLAG basecamp chat delete --profile type=string
15921591
FLAG basecamp chat delete --project type=string
15931592
FLAG basecamp chat delete --quiet type=bool
1593+
FLAG basecamp chat delete --room type=string
15941594
FLAG basecamp chat delete --stats type=bool
15951595
FLAG basecamp chat delete --styled type=bool
15961596
FLAG basecamp chat delete --todolist type=string
15971597
FLAG basecamp chat delete --verbose type=count
15981598
FLAG basecamp chat line --account type=string
15991599
FLAG basecamp chat line --agent type=bool
16001600
FLAG basecamp chat line --cache-dir type=string
1601-
FLAG basecamp chat line --chat type=string
16021601
FLAG basecamp chat line --count type=bool
16031602
FLAG basecamp chat line --hints type=bool
16041603
FLAG basecamp chat line --ids-only type=bool
@@ -1612,6 +1611,7 @@ FLAG basecamp chat line --no-stats type=bool
16121611
FLAG basecamp chat line --profile type=string
16131612
FLAG basecamp chat line --project type=string
16141613
FLAG basecamp chat line --quiet type=bool
1614+
FLAG basecamp chat line --room type=string
16151615
FLAG basecamp chat line --stats type=bool
16161616
FLAG basecamp chat line --styled type=bool
16171617
FLAG basecamp chat line --todolist type=string
@@ -1620,7 +1620,6 @@ FLAG basecamp chat list --account type=string
16201620
FLAG basecamp chat list --agent type=bool
16211621
FLAG basecamp chat list --all type=bool
16221622
FLAG basecamp chat list --cache-dir type=string
1623-
FLAG basecamp chat list --chat type=string
16241623
FLAG basecamp chat list --count type=bool
16251624
FLAG basecamp chat list --hints type=bool
16261625
FLAG basecamp chat list --ids-only type=bool
@@ -1634,14 +1633,14 @@ FLAG basecamp chat list --no-stats type=bool
16341633
FLAG basecamp chat list --profile type=string
16351634
FLAG basecamp chat list --project type=string
16361635
FLAG basecamp chat list --quiet type=bool
1636+
FLAG basecamp chat list --room type=string
16371637
FLAG basecamp chat list --stats type=bool
16381638
FLAG basecamp chat list --styled type=bool
16391639
FLAG basecamp chat list --todolist type=string
16401640
FLAG basecamp chat list --verbose type=count
16411641
FLAG basecamp chat messages --account type=string
16421642
FLAG basecamp chat messages --agent type=bool
16431643
FLAG basecamp chat messages --cache-dir type=string
1644-
FLAG basecamp chat messages --chat type=string
16451644
FLAG basecamp chat messages --count type=bool
16461645
FLAG basecamp chat messages --hints type=bool
16471646
FLAG basecamp chat messages --ids-only type=bool
@@ -1656,14 +1655,14 @@ FLAG basecamp chat messages --no-stats type=bool
16561655
FLAG basecamp chat messages --profile type=string
16571656
FLAG basecamp chat messages --project type=string
16581657
FLAG basecamp chat messages --quiet type=bool
1658+
FLAG basecamp chat messages --room type=string
16591659
FLAG basecamp chat messages --stats type=bool
16601660
FLAG basecamp chat messages --styled type=bool
16611661
FLAG basecamp chat messages --todolist type=string
16621662
FLAG basecamp chat messages --verbose type=count
16631663
FLAG basecamp chat post --account type=string
16641664
FLAG basecamp chat post --agent type=bool
16651665
FLAG basecamp chat post --cache-dir type=string
1666-
FLAG basecamp chat post --chat type=string
16671666
FLAG basecamp chat post --content type=string
16681667
FLAG basecamp chat post --content-type type=string
16691668
FLAG basecamp chat post --count type=bool
@@ -1679,14 +1678,14 @@ FLAG basecamp chat post --no-stats type=bool
16791678
FLAG basecamp chat post --profile type=string
16801679
FLAG basecamp chat post --project type=string
16811680
FLAG basecamp chat post --quiet type=bool
1681+
FLAG basecamp chat post --room type=string
16821682
FLAG basecamp chat post --stats type=bool
16831683
FLAG basecamp chat post --styled type=bool
16841684
FLAG basecamp chat post --todolist type=string
16851685
FLAG basecamp chat post --verbose type=count
16861686
FLAG basecamp chat upload --account type=string
16871687
FLAG basecamp chat upload --agent type=bool
16881688
FLAG basecamp chat upload --cache-dir type=string
1689-
FLAG basecamp chat upload --chat type=string
16901689
FLAG basecamp chat upload --count type=bool
16911690
FLAG basecamp chat upload --hints type=bool
16921691
FLAG basecamp chat upload --ids-only type=bool
@@ -1700,6 +1699,7 @@ FLAG basecamp chat upload --no-stats type=bool
17001699
FLAG basecamp chat upload --profile type=string
17011700
FLAG basecamp chat upload --project type=string
17021701
FLAG basecamp chat upload --quiet type=bool
1702+
FLAG basecamp chat upload --room type=string
17031703
FLAG basecamp chat upload --stats type=bool
17041704
FLAG basecamp chat upload --styled type=bool
17051705
FLAG basecamp chat upload --todolist type=string

.surface-breaking

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,3 +717,17 @@ SUB basecamp uploads vault list
717717
SUB basecamp uploads vaults
718718
SUB basecamp uploads vaults create
719719
SUB basecamp uploads vaults list
720+
FLAG basecamp campfire --chat type=string
721+
FLAG basecamp campfire delete --chat type=string
722+
FLAG basecamp campfire line --chat type=string
723+
FLAG basecamp campfire list --chat type=string
724+
FLAG basecamp campfire messages --chat type=string
725+
FLAG basecamp campfire post --chat type=string
726+
FLAG basecamp campfire upload --chat type=string
727+
FLAG basecamp chat --chat type=string
728+
FLAG basecamp chat delete --chat type=string
729+
FLAG basecamp chat line --chat type=string
730+
FLAG basecamp chat list --chat type=string
731+
FLAG basecamp chat messages --chat type=string
732+
FLAG basecamp chat post --chat type=string
733+
FLAG basecamp chat upload --chat type=string

e2e/errors.bats

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,22 @@ load test_helper
3535
assert_output_contains "Unknown option"
3636
}
3737

38-
@test "chat --chat without value shows error" {
38+
@test "chat --room without value shows error" {
3939
create_credentials
4040
create_global_config '{"account_id": 99999}'
4141

42-
run basecamp chat messages --chat
42+
run basecamp chat messages --room
4343
assert_failure
44-
assert_output_contains "--chat requires a value"
44+
assert_output_contains "--room requires a value"
45+
}
46+
47+
@test "chat --chat is rejected after rename to --room" {
48+
create_credentials
49+
create_global_config '{"account_id": 99999}'
50+
51+
run basecamp chat messages --chat 123
52+
assert_failure
53+
assert_output_contains "Unknown option"
4554
}
4655

4756
@test "comment without recording ID shows error" {

e2e/smoke/smoke_campfire.bats

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ setup_file() {
1616
}
1717

1818
@test "campfire messages returns lines" {
19-
run_smoke basecamp campfire messages --chat "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
19+
run_smoke basecamp campfire messages --room "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
2020
assert_success
2121
assert_json_value '.ok' 'true'
2222
}
2323

2424
@test "campfire post creates a message" {
2525
run_smoke basecamp campfire post "Smoke test $(date +%s)" \
26-
--chat "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
26+
--room "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
2727
assert_success
2828
assert_json_value '.ok' 'true'
2929
assert_json_not_null '.data.id'
@@ -38,7 +38,7 @@ setup_file() {
3838
line_id=$(<"$id_file")
3939

4040
run_smoke basecamp campfire line "$line_id" \
41-
--chat "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
41+
--room "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
4242
assert_success
4343
assert_json_value '.ok' 'true'
4444
assert_json_not_null '.data.id'
@@ -51,7 +51,7 @@ setup_file() {
5151
line_id=$(<"$id_file")
5252

5353
run_smoke basecamp campfire delete "$line_id" \
54-
--chat "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
54+
--room "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
5555
assert_success
5656
assert_json_value '.ok' 'true'
5757
}
@@ -61,7 +61,7 @@ setup_file() {
6161
echo "campfire upload test $(date +%s)" > "$tmpfile"
6262

6363
run_smoke basecamp campfire upload "$tmpfile" \
64-
--chat "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
64+
--room "$QA_CAMPFIRE" -p "$QA_PROJECT" --json
6565
assert_success
6666
assert_json_value '.ok' 'true'
6767
}

internal/cli/help.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ func renderCommandHelp(cmd *cobra.Command) {
304304
}
305305
}
306306

307-
// FLAGS — local flags plus parent-scoped persistent flags (e.g. --chat,
307+
// FLAGS — local flags plus parent-scoped persistent flags (e.g. --room,
308308
// --project defined on a parent command). This promotes parent-scoped
309309
// flags into the primary FLAGS section where they're immediately visible,
310310
// rather than burying them in INHERITED FLAGS alongside root globals.
@@ -325,7 +325,7 @@ func renderCommandHelp(cmd *cobra.Command) {
325325
}
326326

327327
// INHERITED FLAGS — root-level globals only. Parent-scoped persistent
328-
// flags (--project, --chat, etc.) are promoted into FLAGS above.
328+
// flags (--project, --room, etc.) are promoted into FLAGS above.
329329
inherited := filterInheritedFlags(cmd)
330330
if inherited != "" {
331331
b.WriteString("\n")
@@ -388,7 +388,7 @@ func parentScopedFlags(cmd *cobra.Command) *pflag.FlagSet {
388388

389389
// filterInheritedFlags returns formatted flag usages for INHERITED FLAGS,
390390
// containing only the curated subset of root-level globals. Parent-scoped
391-
// persistent flags (--chat, --project on messages, etc.) are excluded here
391+
// persistent flags (--room, --project on messages, etc.) are excluded here
392392
// because parentScopedFlags promotes them into FLAGS.
393393
func filterInheritedFlags(cmd *cobra.Command) string {
394394
root := cmd.Root()

internal/cli/help_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func TestGroupCommandShowsPersistentLocalFlags(t *testing.T) {
147147
{"messages --in", "messages", commands.NewMessagesCmd, "--in"},
148148
{"messages --message-board", "messages", commands.NewMessagesCmd, "--message-board"},
149149
{"chat --project", "chat", commands.NewChatCmd, "--project"},
150-
{"chat --chat", "chat", commands.NewChatCmd, "--chat"},
150+
{"chat --room", "chat", commands.NewChatCmd, "--room"},
151151
}
152152

153153
for _, tt := range tests {
@@ -185,7 +185,7 @@ func TestRootLevelLeafCommandHelp(t *testing.T) {
185185
}
186186

187187
func TestLeafCommandShowsParentScopedFlagsInFLAGS(t *testing.T) {
188-
// Parent-scoped persistent flags (--project, --chat, etc.) are promoted
188+
// Parent-scoped persistent flags (--project, --room, etc.) are promoted
189189
// into the FLAGS section on leaf commands, not buried in INHERITED FLAGS.
190190
// This is a renderer-wide policy: any leaf whose parent defines persistent
191191
// flags will show them in FLAGS.
@@ -204,10 +204,10 @@ func TestLeafCommandShowsParentScopedFlagsInFLAGS(t *testing.T) {
204204
[]string{"--project", "--in", "--message-board"},
205205
},
206206
{
207-
"chat post shows --project and --chat in FLAGS",
207+
"chat post shows --project and --room in FLAGS",
208208
[]string{"chat", "post", "--help"},
209209
commands.NewChatCmd,
210-
[]string{"--project", "--chat"},
210+
[]string{"--project", "--room"},
211211
},
212212
{
213213
"timesheet report shows date and person flags in FLAGS",
@@ -236,8 +236,8 @@ func TestLeafCommandShowsParentScopedFlagsInFLAGS(t *testing.T) {
236236
}
237237
}
238238

239-
func TestCampfirePostHelpShowsChatFlag(t *testing.T) {
240-
// The campfire alias path must also show --chat in FLAGS.
239+
func TestCampfirePostHelpShowsRoomFlag(t *testing.T) {
240+
// The campfire alias path must also show --room in FLAGS.
241241
isolateHelpTest(t)
242242

243243
var buf bytes.Buffer
@@ -249,7 +249,7 @@ func TestCampfirePostHelpShowsChatFlag(t *testing.T) {
249249

250250
out := buf.String()
251251
flagsSection := extractSection(out, "FLAGS")
252-
assert.Contains(t, flagsSection, "--chat")
252+
assert.Contains(t, flagsSection, "--room")
253253
assert.Contains(t, flagsSection, "--project")
254254
}
255255

0 commit comments

Comments
 (0)