本文整理汇总了Golang中github.com/prasmussen/gdrive/cli.Arguments类的典型用法代码示例。如果您正苦于以下问题:Golang Arguments类的具体用法?Golang Arguments怎么用?Golang Arguments使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Arguments类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: getConfigDir
func getConfigDir(args cli.Arguments) string {
// Use dir from environment var if present
if os.Getenv("GDRIVE_CONFIG_DIR") != "" {
return os.Getenv("GDRIVE_CONFIG_DIR")
}
return args.String("configDir")
}
开发者ID:RandomArray,项目名称:gdrive,代码行数:7,代码来源:handlers_drive.go
示例2: checkUploadArgs
func checkUploadArgs(args cli.Arguments) {
if args.Bool("recursive") && args.Bool("delete") {
ExitF("--delete is not allowed for recursive uploads")
}
if args.Bool("recursive") && args.Bool("share") {
ExitF("--share is not allowed for recursive uploads")
}
}
开发者ID:RandomArray,项目名称:gdrive,代码行数:9,代码来源:handlers_drive.go
示例3: conflictResolution
func conflictResolution(args cli.Arguments) drive.ConflictResolution {
keepLocal := args.Bool("keepLocal")
keepRemote := args.Bool("keepRemote")
keepLargest := args.Bool("keepLargest")
if (keepLocal && keepRemote) || (keepLocal && keepLargest) || (keepRemote && keepLargest) {
ExitF("Only one conflict resolution flag can be given")
}
if keepLocal {
return drive.KeepLocal
}
if keepRemote {
return drive.KeepRemote
}
if keepLargest {
return drive.KeepLargest
}
return drive.NoResolution
}
开发者ID:RandomArray,项目名称:gdrive,代码行数:23,代码来源:handlers_drive.go
示例4: checkDownloadArgs
func checkDownloadArgs(args cli.Arguments) {
if args.Bool("recursive") && args.Bool("delete") {
ExitF("--delete is not allowed for recursive downloads")
}
}
开发者ID:RandomArray,项目名称:gdrive,代码行数:5,代码来源:handlers_drive.go
示例5: getOauthClient
func getOauthClient(args cli.Arguments) (*http.Client, error) {
if args.String("refreshToken") != "" && args.String("accessToken") != "" {
ExitF("Access token not needed when refresh token is provided")
}
if args.String("refreshToken") != "" {
return auth.NewRefreshTokenClient(ClientId, ClientSecret, args.String("refreshToken")), nil
}
if args.String("accessToken") != "" {
return auth.NewAccessTokenClient(ClientId, ClientSecret, args.String("accessToken")), nil
}
configDir := getConfigDir(args)
tokenPath := ConfigFilePath(configDir, TokenFilename)
return auth.NewFileSourceClient(ClientId, ClientSecret, tokenPath, authCodePrompt)
}
开发者ID:RandomArray,项目名称:gdrive,代码行数:17,代码来源:handlers_drive.go
注:本文中的github.com/prasmussen/gdrive/cli.Arguments类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论