Skip to content

Commit a0c6def

Browse files
committed
Add list job limit
1 parent 21ef28e commit a0c6def

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func runCommand(parsed string, commandData *commands.CommandData) {
2020
commandData.RegisterCommand()
2121

2222
case jobs.FullCommand():
23-
commandData.ListJobs()
23+
commandData.ListJobs(*jobsn)
2424

2525
case aurBuild.FullCommand():
2626
commandData.CreateAURJob(*aurbuildPackage, *jobUploadTo, *jobDisableCcache)

commands/Jobs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import (
1717
)
1818

1919
// ListJobs list active jobs
20-
func (cData *CommandData) ListJobs() {
21-
jobs, err := cData.Librb.ListJobs()
20+
func (cData *CommandData) ListJobs(limit int) {
21+
jobs, err := cData.Librb.ListJobs(limit)
2222
if err != nil {
2323
printResponseError(err, "retrieving job list")
2424
return

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.14
55
require (
66
github.com/DataManager-Go/libdatamanager v1.3.8 // indirect
77
github.com/DataManager-Go/libdatamanager/config v0.0.0-20200717181208-26ce39a85e00
8-
github.com/JojiiOfficial/LibRemotebuild v0.1.6
8+
github.com/JojiiOfficial/LibRemotebuild v0.1.7
99
github.com/JojiiOfficial/LibRemotebuild/config v0.0.0-20200719190817-656fb15fe37d
1010
github.com/JojiiOfficial/configService v0.0.0-20200219132202-6e71512e2e28
1111
github.com/JojiiOfficial/gaw v1.2.8

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ github.com/JojiiOfficial/LibRemotebuild v0.0.3 h1:MdXvqIlVcdXCcBf/XDbPxvhCF+Wwur
99
github.com/JojiiOfficial/LibRemotebuild v0.0.3/go.mod h1:NS5D8NlALafEHK8LmRctE22sM4JjOlZyCwoXA//P2nU=
1010
github.com/JojiiOfficial/LibRemotebuild v0.1.6 h1:r3t6W/r7/OIbKHH79rzbdwEbneL+5a2C20LKrw61es4=
1111
github.com/JojiiOfficial/LibRemotebuild v0.1.6/go.mod h1:NS5D8NlALafEHK8LmRctE22sM4JjOlZyCwoXA//P2nU=
12+
github.com/JojiiOfficial/LibRemotebuild v0.1.7 h1:T7feY82UZsbxm1/ZYbfVMg9sTptjyd/NqZTPIh+5BNY=
13+
github.com/JojiiOfficial/LibRemotebuild v0.1.7/go.mod h1:NS5D8NlALafEHK8LmRctE22sM4JjOlZyCwoXA//P2nU=
1214
github.com/JojiiOfficial/LibRemotebuild/config v0.0.0-20200719190817-656fb15fe37d h1:u+9737TTrBGgRSJFS+yMym1+LdVt+eWK7kLH3kzXCuU=
1315
github.com/JojiiOfficial/LibRemotebuild/config v0.0.0-20200719190817-656fb15fe37d/go.mod h1:lxGR/6KclpgZK45zYp8Fez3LbhrWIOI3ZYM0jFAkYFo=
1416
github.com/JojiiOfficial/configService v0.0.0-20200219132202-6e71512e2e28 h1:nYoIExG+Z/gSLS9Jbpu6lnrh+m6e9gTxQfGhanTsExE=

main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ var (
5858
loginCmd = app.Command("login", "Login into an existing account")
5959
registerCmd = app.Command("register", "Create a new account")
6060

61-
jobs = app.Command("jobs", "List active jobs").Alias("js")
61+
jobs = app.Command("jobs", "List active jobs").Alias("js")
62+
jobsn = jobs.Flag("limit", "Limit the jobs to display").Short('n').Int()
6263

6364
// Job commands
6465
job = app.Command("job", "Job actions").Alias("j")

0 commit comments

Comments
 (0)