mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-28 23:09:37 +00:00
36 lines
1.4 KiB
Go
36 lines
1.4 KiB
Go
// Copyright 2020 Rancher Labs, 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 flag
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
var _ = time.Time{}
|
|
|
|
// StringVar defines a string flag with specified name, default value, and usage string.
|
|
// The argument p points to a string variable in which to store the value of the flag.
|
|
func (f *FlagSet) StringVar(ptr *string, name string, value string, usage string) {
|
|
f.GenericVar(ptr, name, value, usage)
|
|
}
|
|
|
|
// String defines a string flag with specified name, default value, and usage string.
|
|
// The return value is the address of a string variable that stores the value of the flag.
|
|
func (f *FlagSet) String(name string, value string, usage string) *string {
|
|
return f.Generic(name, value, usage).(*string)
|
|
}
|
|
|
|
// StringVar defines a string flag with specified name, default value, and usage string.
|
|
// The argument p points to a string variable in which to store the value of the flag.
|
|
func StringVar(ptr *string, name string, value string, usage string) {
|
|
CommandLine.GenericVar(ptr, name, value, usage)
|
|
}
|
|
|
|
// String defines a string flag with specified name, default value, and usage string.
|
|
// The return value is the address of a string variable that stores the value of the flag.
|
|
func String(name string, value string, usage string) *string {
|
|
return CommandLine.Generic(name, value, usage).(*string)
|
|
}
|