github.com/olivere/camlistore@v0.0.0-20140121221811-1b7ac2da0199/cmd/camtool/list.go (about) 1 /* 2 Copyright 2014 The Camlistore Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package main 18 19 import ( 20 "flag" 21 "fmt" 22 "os" 23 24 "camlistore.org/pkg/cmdmain" 25 ) 26 27 type listCmd struct { 28 *syncCmd 29 } 30 31 func init() { 32 cmdmain.RegisterCommand("list", func(flags *flag.FlagSet) cmdmain.CommandRunner { 33 cmd := &listCmd{ 34 &syncCmd{ 35 dest: "stdout", 36 }, 37 } 38 flags.StringVar(&cmd.src, "src", "", "Source blobserver is either a URL prefix (with optional path), a host[:port], a path (starting with /, ./, or ../), or blank to use the Camlistore client config's default host.") 39 flags.BoolVar(&cmd.verbose, "verbose", false, "Be verbose.") 40 return cmd 41 }) 42 } 43 44 func (c *listCmd) Describe() string { 45 return "List blobs on a server." 46 } 47 48 func (c *listCmd) Usage() { 49 fmt.Fprintf(os.Stderr, "Usage: camtool [globalopts] list [listopts] \n") 50 } 51 52 func (c *listCmd) Examples() []string { 53 return nil 54 }