代码拉取完成,页面将自动刷新
package cmd
import (
"errors"
"fmt"
"os"
"github.com/spf13/cobra"
)
var (
ossProvider string
vers bool
ossEndpoint string
aliAccessID string
aliSecretKey string
)
// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "cloud-station-cli",
Short: "cloud-station-cli 文件中转服务",
Long: `cloud-station-cli ...`,
RunE: func(cmd *cobra.Command, args []string) error {
if vers {
fmt.Println("0.0.1")
return nil
}
return errors.New("no flags find")
},
}
// Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
if err := RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
func init() {
// -i, --ali_access_id
RootCmd.PersistentFlags().StringVarP(&ossProvider, "provider", "p", "aliyun", "the oss provider [ali/tx/aws]")
RootCmd.PersistentFlags().StringVarP(&ossEndpoint, "oss_endpoint", "e", "", "oss service endpint")
RootCmd.PersistentFlags().StringVarP(&aliAccessID, "ali_access_id", "i", "", "the ali oss access id")
RootCmd.PersistentFlags().BoolVarP(&vers, "version", "v", false, "the cloud-station-cli version")
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。