diff --git a/cmd/jobs.go b/cmd/jobs.go index e48627a..1716fdc 100644 --- a/cmd/jobs.go +++ b/cmd/jobs.go @@ -36,10 +36,10 @@ func makeJobs() *cobra.Command { func runJobsE(cmd *cobra.Command, args []string) error { - if len(args) < 1 { - return fmt.Errorf("give an owner as an argument") + var owner string + if len(args) == 1 { + owner = strings.TrimSpace(args[0]) } - owner := strings.TrimSpace(args[0]) pat, err := getPat(cmd) if err != nil { diff --git a/cmd/runners.go b/cmd/runners.go index db993b6..bd960a9 100644 --- a/cmd/runners.go +++ b/cmd/runners.go @@ -37,10 +37,10 @@ func makeRunners() *cobra.Command { func runRunnersE(cmd *cobra.Command, args []string) error { - if len(args) < 1 { - return fmt.Errorf("give an owner as an argument") + var owner string + if len(args) == 1 { + owner = strings.TrimSpace(args[0]) } - owner := strings.TrimSpace(args[0]) pat, err := getPat(cmd) if err != nil { diff --git a/pkg/client.go b/pkg/client.go index 0c6f198..eec634e 100644 --- a/pkg/client.go +++ b/pkg/client.go @@ -3,6 +3,7 @@ package pkg import ( "fmt" "io" + "log" "net/http" "net/url" "os" @@ -87,6 +88,7 @@ func (c *Client) ListRunners(patStr string, owner string, staff bool, json bool) if len(owner) > 0 { q.Set("owner", owner) + log.Printf("Requesting runners for owner %s", owner) } u.RawQuery = q.Encode()