File: list.go

package info (click to toggle)
golang-github-pborman-getopt 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: makefile: 2
file content (32 lines) | stat: -rw-r--r-- 929 bytes parent folder | download | duplicates (2)
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
// Copyright 2017 Google Inc.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package getopt

// List creates an option that returns a slice of strings.  The parameters
// passed are converted from a comma separated value list into a slice.
// Subsequent occurrences append to the list.
func List(name rune, helpvalue ...string) *[]string {
	p := []string{}
	CommandLine.Flag(&p, name, helpvalue...)
	return &p
}

func (s *Set) List(name rune, helpvalue ...string) *[]string {
	p := []string{}
	s.Flag(&p, name, helpvalue...)
	return &p
}

func ListLong(name string, short rune, helpvalue ...string) *[]string {
	p := []string{}
	CommandLine.FlagLong(&p, name, short, helpvalue...)
	return &p
}

func (s *Set) ListLong(name string, short rune, helpvalue ...string) *[]string {
	p := []string{}
	s.FlagLong(&p, name, short, helpvalue...)
	return &p
}