| Index: client/cmd/buildbucket/get.go
|
| diff --git a/client/cmd/buildbucket/get.go b/client/cmd/buildbucket/get.go
|
| deleted file mode 100644
|
| index c34b0074c0ae34c1ebb4ce5af3a9abddf1b064e0..0000000000000000000000000000000000000000
|
| --- a/client/cmd/buildbucket/get.go
|
| +++ /dev/null
|
| @@ -1,65 +0,0 @@
|
| -// Copyright 2016 The LUCI Authors. All rights reserved.
|
| -// Use of this source code is governed under the Apache License, Version 2.0
|
| -// that can be found in the LICENSE file.
|
| -
|
| -package main
|
| -
|
| -import (
|
| - "fmt"
|
| - "strconv"
|
| -
|
| - "github.com/maruel/subcommands"
|
| -
|
| - "github.com/luci/luci-go/common/cli"
|
| - "github.com/luci/luci-go/common/logging"
|
| -)
|
| -
|
| -var cmdGet = &subcommands.Command{
|
| - UsageLine: `get [flags] <build id>`,
|
| - ShortDesc: "get details about a build",
|
| - LongDesc: "Get details about a build.",
|
| - CommandRun: func() subcommands.CommandRun {
|
| - c := &getRun{}
|
| - c.SetDefaultFlags()
|
| - return c
|
| - },
|
| -}
|
| -
|
| -type getRun struct {
|
| - baseCommandRun
|
| -}
|
| -
|
| -func (r *getRun) Run(a subcommands.Application, args []string) int {
|
| - ctx := cli.GetContext(a, r)
|
| - if len(args) < 1 {
|
| - logging.Errorf(ctx, "missing parameter: <Build ID>")
|
| - return 1
|
| - } else if len(args) > 1 {
|
| - logging.Errorf(ctx, "unexpected arguments: %s", args[1:])
|
| - }
|
| -
|
| - buildId, err := strconv.ParseInt(args[0], 10, 64)
|
| - if err != nil {
|
| - logging.Errorf(ctx, "expected a build id (int64): %s", err)
|
| - return 1
|
| - }
|
| -
|
| - service, err := r.makeService(ctx, a)
|
| - if err != nil {
|
| - return 1
|
| - }
|
| -
|
| - response, err := service.Get(buildId).Do()
|
| - if err != nil {
|
| - logging.Errorf(ctx, "buildbucket.Get failed: %s", err)
|
| - return 1
|
| - }
|
| -
|
| - responseJSON, err := response.MarshalJSON()
|
| - if err != nil {
|
| - logging.Errorf(ctx, "could not unmarshal response: %s", err)
|
| - return 1
|
| - }
|
| - fmt.Println(string(responseJSON))
|
| - return 0
|
| -}
|
|
|