1 Star 0 Fork 0

麻本法 / go.gpio-ctl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
root.go 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
/*
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,
})
}
1
https://gitee.com/zinface/gpio-ctl.git
git@gitee.com:zinface/gpio-ctl.git
zinface
gpio-ctl
go.gpio-ctl
3957fa38168a

搜索帮助