代码拉取完成,页面将自动刷新
/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
"os"
"github.com/spf13/cobra"
)
const (
_desc_root = "GPIO 操作工具"
_desc_info = "GPIO 获取指定编号信息"
_desc_setvalue = "GPIO 设置指定编号值"
_desc_getvalue = "GPIO 获取指定编号值"
_desc_getmode_ = "GPIO 获取指定编号模式"
_desc_setmode_ = "GPIO 设置指定编号模式"
// Export the specified gpio device
_desc_export = "导出指定的gpio设备"
// UnExport the specified gpio device
_desc_unexport = "取消导出指定的gpio设备"
)
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "gpio-ctl",
Short: _desc_root,
Long: ``,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.gpio-led.yaml)")
// Cobra also supports local flags, which will only run
// when this action is called directly.
// rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
rootCmd.AddCommand(&cobra.Command{
Use: "completion",
Hidden: true,
})
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。