Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#394 added cli option --room #414

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.5.1
- Feature: Added cli option `--room` to set the room name of timer.mob.sh once

# 4.5.0
- Removes feature which cancels running timers as this can lead to longer rotations if the codebase is switched. The way it was implemented is also not ideal for virus detection.
- Correct typo in the hint for creating a remote branch
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ Basic Commands(Options):
[--include-uncommitted-changes|-i] Move uncommitted changes to wip branch
[--branch|-b <branch-postfix>] Set wip branch to 'mob/<base-branch>-<branch-postfix>'
[--create] Create the remote branch
[--room <room-name>] Set room name for timer.mob.sh once
next
[--stay|-s] Stay on wip branch (default)
[--return-to-base-branch|-r] Return to base branch
Expand All @@ -188,10 +189,12 @@ Basic Commands(Options):
[--branch|-b <branch-postfix>] Set wip branch to 'mob/<base-branch>/<branch-postfix>'

Timer Commands:
timer <minutes> start a <minutes> timer
timer open opens the timer website
start <minutes> start mob session in wip branch and a <minutes> timer
break <minutes> start a <minutes> break timer
timer <minutes> Start a <minutes> timer
[--room <room-name>] Set room name for timer.mob.sh once
timer open Opens the timer website
[--room <room-name>] Set room name for timer.mob.sh once
start <minutes> Start mob session in wip branch and a <minutes> timer
break <minutes> Start a <minutes> break timer

Short Commands (Options and descriptions as above):
s alias for 'start'
Expand Down
6 changes: 6 additions & 0 deletions configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ func ParseArgs(args []string, configuration Configuration) (command string, para
newConfiguration.StartCreate = true
case "--delete-remote-wip-branch":
newConfiguration.ResetDeleteRemoteWipBranch = true
case "--room":
if i+1 != len(args) {
newConfiguration.TimerRoom = args[i+1]
}
gregorriegler marked this conversation as resolved.
Show resolved Hide resolved
i++ // skip consumed parameter

default:
if i == 1 {
command = arg
Expand Down
33 changes: 33 additions & 0 deletions configuration/configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,39 @@ func TestParseArgsMessage(t *testing.T) {
test.Equals(t, "ci-skip", configuration.WipCommitMessage)
}

func TestParseArgsStartRoom(t *testing.T) {
configuration := GetDefaultConfiguration()
test.Equals(t, configuration.WipBranchQualifier, "")

command, parameters, configuration := ParseArgs([]string{"mob", "start", "--room", "testroom"}, configuration)

test.Equals(t, "start", command)
test.Equals(t, "", strings.Join(parameters, ""))
test.Equals(t, "testroom", configuration.TimerRoom)
}

func TestParseArgsTimerRoom(t *testing.T) {
configuration := GetDefaultConfiguration()
test.Equals(t, configuration.WipBranchQualifier, "")

command, parameters, configuration := ParseArgs([]string{"mob", "timer", "10", "--room", "testroom"}, configuration)

test.Equals(t, "timer", command)
test.Equals(t, "10", strings.Join(parameters, ""))
test.Equals(t, "testroom", configuration.TimerRoom)
}

func TestParseArgsTimerOpenRoom(t *testing.T) {
configuration := GetDefaultConfiguration()
test.Equals(t, configuration.WipBranchQualifier, "")

command, parameters, configuration := ParseArgs([]string{"mob", "timer", "open", "--room", "testroom"}, configuration)

test.Equals(t, "timer", command)
test.Equals(t, "open", strings.Join(parameters, ""))
test.Equals(t, "testroom", configuration.TimerRoom)
}

gregorriegler marked this conversation as resolved.
Show resolved Hide resolved
func TestMobRemoteNameEnvironmentVariable(t *testing.T) {
configuration := setEnvVarAndParse("MOB_REMOTE_NAME", "GITHUB")
test.Equals(t, "GITHUB", configuration.RemoteName)
Expand Down
11 changes: 7 additions & 4 deletions help/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Basic Commands with Options:
[--include-uncommitted-changes|-i] Move uncommitted changes to wip branch
[--branch|-b <branch-postfix>] Set wip branch to 'mob/<base-branch>` + configuration.WipBranchQualifierSeparator + `<branch-postfix>'
[--create] Create the remote branch
[--room <room-name>] Set room name for timer.mob.sh once
next
[--stay|-s] Stay on wip branch (default)
[--return-to-base-branch|-r] Return to base branch
Expand All @@ -32,10 +33,12 @@ Basic Commands with Options:
[--branch|-b <branch-postfix>] Set wip branch to 'mob/<base-branch>` + configuration.WipBranchQualifierSeparator + `<branch-postfix>'

Timer Commands:
timer <minutes> Start <minutes> minutes timer
timer open Opens the timer website
start <minutes> Start mob session in wip branch and a <minutes> timer
break <minutes> Start <minutes> break timer
timer <minutes> Start a <minutes> timer
[--room <room-name>] Set room name for timer.mob.sh once
timer open Opens the timer website
[--room <room-name>] Set room name for timer.mob.sh once
start <minutes> Start mob session in wip branch and a <minutes> timer
break <minutes> Start a <minutes> break timer

Short Commands (Options and descriptions as above):
s Alias for 'start'
Expand Down
Loading