// Copyright 2015 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 common

import (
	"github.com/kr/pretty"
)

// Strings accumulates string values from repeated flags.
//
// Use with flag.Var to accumulate values from "-flag s1 -flag s2".
type Strings []string

func (c *Strings) String() string {
	return pretty.Sprintf("%v", []string(*c))
}

// Set is needed to implements flag.Var interface.
func (c *Strings) Set(value string) error {
	*c = append(*c, value)
	return nil
}

// Copyright 2015 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 common

import (
	"fmt"
)

// Strings accumulates string values from repeated flags.
//
// Use with flag.Var to accumulate values from "-flag s1 -flag s2".
type Strings []string

func (c *Strings) String() string {
	return fmt.Sprintf("%v", []string(*c))
}

// Set is needed to implements flag.Var interface.
func (c *Strings) Set(value string) error {
	*c = append(*c, value)
	return nil
}

Remove some dependency on pretty package.
Remove some dependency on pretty package.

The pretty package (https://godoc.org/github.com/kr/pretty) provides
pretty-printing capability. In this instance, however, the package was
not actually doing anything above and beyond the base fmt package, so it
can be removed. Since this is common code in client, it simplifies
dependencies required.

R=maruel@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2636183003
