blob: 864792798bccf52be9446cb78c657c0dbd0e8fdd [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package command
import (
"strings"
)
// StringsFlag implements flag.Value so it may be treated as a flag type.
type StringsFlag []string
// Set implements flag.Value.Set.
func (s *StringsFlag) Set(val string) error {
*s = append(*s, val)
return nil
}
// String implements flag.Value.String.
func (s *StringsFlag) String() string {
if s == nil {
return ""
}
return strings.Join([]string(*s), ", ")
}