File: string.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 (27 lines) | stat: -rw-r--r-- 879 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
// 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

// String returns a value option that stores is value as a string.  The
// initial value of the string is passed in value.
func String(name rune, value string, helpvalue ...string) *string {
	CommandLine.Flag(&value, name, helpvalue...)
	return &value
}

func (s *Set) String(name rune, value string, helpvalue ...string) *string {
	s.Flag(&value, name, helpvalue...)
	return &value
}

func StringLong(name string, short rune, value string, helpvalue ...string) *string {
	CommandLine.FlagLong(&value, name, short, helpvalue...)
	return &value
}

func (s *Set) StringLong(name string, short rune, value string, helpvalue ...string) *string {
	s.FlagLong(&value, name, short, helpvalue...)
	return &value
}