| // Copyright 2015 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| "golang.org/x/build/buildlet" |
| func ls(args []string) error { |
| fs := flag.NewFlagSet("ls", flag.ContinueOnError) |
| fmt.Fprintln(os.Stderr, "create usage: gomote ls <instance> [-R] [dir]") |
| fs.BoolVar(&recursive, "R", false, "recursive") |
| fs.BoolVar(&digest, "d", false, "get file digests") |
| fs.StringVar(&skip, "skip", "", "comma-separated list of relative directories to skip (use forward slashes)") |
| if n := fs.NArg(); n < 1 || n > 2 { |
| bc, err := namedClient(name) |
| opts := buildlet.ListDirOpts{ |
| Skip: strings.Split(skip, ","), |
| return bc.ListDir(dir, opts, func(bi buildlet.DirEntry) { |
| fmt.Fprintf(os.Stdout, "%s\n", bi) |