1 Star 0 Fork 0

powerpaas/machine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
cmd/docker-machine
commands
commandstest
fake_command_line.go
stdout_capture.go
mcndirs
active.go
active_test.go
commands.go
commands_test.go
config.go
create.go
create_test.go
env.go
env_test.go
flag_sort.go
inspect.go
inspect_test.go
ip.go
ip_test.go
kill.go
kill_test.go
ls.go
ls_test.go
mount.go
mount_test.go
provision.go
provision_test.go
regeneratecerts.go
restart.go
rm.go
rm_test.go
scp.go
scp_test.go
scp_unix.go
scp_windows.go
ssh.go
ssh_test.go
start.go
status.go
stop.go
stop_test.go
upgrade.go
url.go
url_test.go
version.go
version_test.go
contrib/completion
docs
drivers
experimental
its
libmachine
mk
script
test
vendor
version
.dockerignore
.gitignore
.gitlab-ci.yml
.godir
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
Dockerfile
Gopkg.lock
Gopkg.toml
LICENSE
MAINTAINERS
Makefile
Makefile.inc
README.md
ROADMAP.md
appveyor.yml
circle.yml
doc.go
克隆/下载
fake_command_line.go 1.93 KB
一键复制 编辑 原始数据 按行查看 历史
package commandstest
import (
"github.com/codegangsta/cli"
)
type FakeFlagger struct {
Data map[string]interface{}
}
type FakeCommandLine struct {
LocalFlags, GlobalFlags *FakeFlagger
HelpShown, VersionShown bool
CliArgs []string
}
func (ff FakeFlagger) String(key string) string {
if value, ok := ff.Data[key]; ok {
return value.(string)
}
return ""
}
func (ff FakeFlagger) StringSlice(key string) []string {
if value, ok := ff.Data[key]; ok {
return value.([]string)
}
return []string{}
}
func (ff FakeFlagger) Int(key string) int {
if value, ok := ff.Data[key]; ok {
return value.(int)
}
return 0
}
func (ff FakeFlagger) Bool(key string) bool {
if value, ok := ff.Data[key]; ok {
return value.(bool)
}
return false
}
func (fcli *FakeCommandLine) IsSet(key string) bool {
_, ok := fcli.LocalFlags.Data[key]
return ok
}
func (fcli *FakeCommandLine) String(key string) string {
return fcli.LocalFlags.String(key)
}
func (fcli *FakeCommandLine) StringSlice(key string) []string {
return fcli.LocalFlags.StringSlice(key)
}
func (fcli *FakeCommandLine) Int(key string) int {
return fcli.LocalFlags.Int(key)
}
func (fcli *FakeCommandLine) Bool(key string) bool {
if fcli.LocalFlags == nil {
return false
}
return fcli.LocalFlags.Bool(key)
}
func (fcli *FakeCommandLine) GlobalString(key string) string {
return fcli.GlobalFlags.String(key)
}
func (fcli *FakeCommandLine) Generic(name string) interface{} {
return fcli.LocalFlags.Data[name]
}
func (fcli *FakeCommandLine) FlagNames() []string {
flagNames := []string{}
for key := range fcli.LocalFlags.Data {
flagNames = append(flagNames, key)
}
return flagNames
}
func (fcli *FakeCommandLine) ShowHelp() {
fcli.HelpShown = true
}
func (fcli *FakeCommandLine) Application() *cli.App {
return cli.NewApp()
}
func (fcli *FakeCommandLine) Args() cli.Args {
return fcli.CliArgs
}
func (fcli *FakeCommandLine) ShowVersion() {
fcli.VersionShown = true
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/powerpaas/machine.git
git@gitee.com:powerpaas/machine.git
powerpaas
machine
machine
v0.15.0-rancher11

搜索帮助