MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / execute

Function execute

mob.go:309–383  ·  view source on GitHub ↗
(command string, parameter []string, configuration config.Configuration)

Source from the content-addressed store, hash-verified

307}
308
309func execute(command string, parameter []string, configuration config.Configuration) {
310 if helpRequested(parameter) {
311 help.Help(configuration)
312 return
313 }
314
315 switch command {
316 case "s", "start":
317 err := start(configuration)
318 if !isMobProgramming(configuration) || err != nil {
319 Exit(1)
320 }
321 if len(parameter) > 0 {
322 timer := parameter[0]
323 StartTimer(timer, configuration)
324 } else if configuration.Timer != "" {
325 StartTimer(configuration.Timer, configuration)
326 } else {
327 say.Info("It's now " + currentTime() + ". Happy collaborating! :)")
328 }
329 case "b", "branch":
330 branch(configuration)
331 case "n", "next":
332 next(configuration)
333 case "d", "done":
334 done(configuration)
335 case "fetch":
336 fetch(configuration)
337 case "reset":
338 reset(configuration)
339 case "clean":
340 clean(configuration)
341 case "config":
342 config.Config(configuration)
343 case "status":
344 status(configuration)
345 case "t", "timer":
346 if len(parameter) > 0 {
347 if parameter[0] == "open" || parameter[0] == "o" {
348 if err := openTimerInBrowser(configuration); err != nil {
349 say.Error(fmt.Sprintf("Could not open webtimer: %s", err.Error()))
350 }
351 } else {
352 timer := parameter[0]
353 StartTimer(timer, configuration)
354 }
355 } else if configuration.Timer != "" {
356 StartTimer(configuration.Timer, configuration)
357 } else {
358 help.Help(configuration)
359 }
360 case "break":
361 if len(parameter) > 0 {
362 StartBreakTimer(parameter[0], configuration)
363 } else {
364 help.Help(configuration)
365 }
366 case "moo":

Calls 15

HelpFunction · 0.92
InfoFunction · 0.92
ErrorFunction · 0.92
GoalFunction · 0.92
helpRequestedFunction · 0.85
startFunction · 0.85
isMobProgrammingFunction · 0.85
StartTimerFunction · 0.85
currentTimeFunction · 0.85
branchFunction · 0.85
nextFunction · 0.85
doneFunction · 0.85