summaryrefslogtreecommitdiff
blob: c997f450a08d0c8802006404f9b16a41ed4449c1 (plain)
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
package members

import (
  "flag"
  "fmt"
  "os"
  "strings"

  "github.com/google/subcommands"
  "golang.org/x/net/context"
)

type listCmd struct {
  membersListPath string
}

func (*listCmd) Name() string     { return "list" }
func (*listCmd) Synopsis() string { return "list members to stdout." }
func (*listCmd) Usage() string {
  return `print --membersListPath /path/to/members`
}

func (p *listCmd) SetFlags(f *flag.FlagSet) {
   f.StringVar(&p.membersListPath, "membersListPath", './members', "path to members list")
}

func (p *listCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus {
  for _, arg := range f.Args() {
    fmt.Printf("%s ", arg)
  }
  fmt.Println()
  return subcommands.ExitSuccess
}