diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ab49055..01d29ad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index f750b301..ac750ab1 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,7 @@ Basic Commands(Options): [--include-uncommitted-changes|-i] Move uncommitted changes to wip branch [--branch|-b ] Set wip branch to 'mob/-' [--create] Create the remote branch + [--room ] 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 @@ -188,10 +189,12 @@ Basic Commands(Options): [--branch|-b ] Set wip branch to 'mob//' Timer Commands: - timer start a timer - timer open opens the timer website - start start mob session in wip branch and a timer - break start a break timer + timer Start a timer + [--room ] Set room name for timer.mob.sh once + timer open Opens the timer website + [--room ] Set room name for timer.mob.sh once + start Start mob session in wip branch and a timer + break Start a break timer Short Commands (Options and descriptions as above): s alias for 'start' diff --git a/configuration/configuration.go b/configuration/configuration.go index e22ed6a2..7f7a48be 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -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] + } + i++ // skip consumed parameter + default: if i == 1 { command = arg diff --git a/configuration/configuration_test.go b/configuration/configuration_test.go index a353602f..7843ad25 100644 --- a/configuration/configuration_test.go +++ b/configuration/configuration_test.go @@ -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) +} + func TestMobRemoteNameEnvironmentVariable(t *testing.T) { configuration := setEnvVarAndParse("MOB_REMOTE_NAME", "GITHUB") test.Equals(t, "GITHUB", configuration.RemoteName) diff --git a/help/help.go b/help/help.go index d7378aa1..d14d6903 100644 --- a/help/help.go +++ b/help/help.go @@ -20,6 +20,7 @@ Basic Commands with Options: [--include-uncommitted-changes|-i] Move uncommitted changes to wip branch [--branch|-b ] Set wip branch to 'mob/` + configuration.WipBranchQualifierSeparator + `' [--create] Create the remote branch + [--room ] 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 @@ -32,10 +33,12 @@ Basic Commands with Options: [--branch|-b ] Set wip branch to 'mob/` + configuration.WipBranchQualifierSeparator + `' Timer Commands: - timer Start minutes timer - timer open Opens the timer website - start Start mob session in wip branch and a timer - break Start break timer + timer Start a timer + [--room ] Set room name for timer.mob.sh once + timer open Opens the timer website + [--room ] Set room name for timer.mob.sh once + start Start mob session in wip branch and a timer + break Start a break timer Short Commands (Options and descriptions as above): s Alias for 'start'