-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommand.go
58 lines (41 loc) · 1.49 KB
/
Command.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"time"
libremotebuild "github.com/RemoteBuild/LibRemotebuild"
"github.com/RemoteBuild/RemoteBuildClient/commands"
)
func runCommand(parsed string, commandData *commands.CommandData) {
// Execute the desired command
switch parsed {
case setupCmd.FullCommand():
commandData.SetupClient(*setupCmdHost, *appCfgFile, *setupCmdIgnoreCert, *setupCmdServerOnly, *setupCmdRegister, *setupCmdLogin, *setupCmdToken, *setupCmdUser)
case loginCmd.FullCommand():
commandData.LoginCommand("")
case registerCmd.FullCommand():
commandData.RegisterCommand()
case jobs.FullCommand():
commandData.ListJobs(*jobsn)
case aurBuild.FullCommand():
commandData.CreateAURJob(*aurbuildPackage, *jobUploadTo, *jobDisableCcache)
case jobCancelCmd.FullCommand():
commandData.CancelJob(*jobCancelID)
case jobPauseCmd.FullCommand():
commandData.SetJobState(*jobPauseID, libremotebuild.JobPaused)
case jobResumeCmd.FullCommand():
commandData.SetJobState(*jobResumeID, libremotebuild.JobRunning)
case jobLogsCmd.FullCommand():
// Get logs starting 20 sec ago
start := time.Unix(time.Now().Unix()-20, 0)
commandData.Logs(*jobLogsID, start, true)
case logsCmd.FullCommand():
// Get logs starting 20 sec ago
start := time.Unix(time.Now().Unix()-20, 0)
commandData.Logs(*logsID, start, true)
case ccacheClearCmd.FullCommand():
commandData.ClearCcache()
case ccacheInfoCmd.FullCommand():
commandData.QueryCcache()
case jobInfo.FullCommand():
commandData.JobInfo(*jobInfoID)
}
}