Update CLI commands
This commit is contained in:
parent
3a06d99c8b
commit
98436b9e4d
7 changed files with 79 additions and 28 deletions
|
@ -13,13 +13,8 @@ import (
|
||||||
// controllerCmd represents the controller command
|
// controllerCmd represents the controller command
|
||||||
var controllerCmd = &cobra.Command{
|
var controllerCmd = &cobra.Command{
|
||||||
Use: "controller",
|
Use: "controller",
|
||||||
Short: "A brief description of your command",
|
Short: "controller command description",
|
||||||
Long: `A longer description that spans multiple lines and likely contains examples
|
Long: `controller command description`,
|
||||||
and usage of using your command. For example:
|
|
||||||
|
|
||||||
Cobra is a CLI library for Go that empowers applications.
|
|
||||||
This application is a tool to generate the needed files
|
|
||||||
to quickly create a Cobra application.`,
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Println("controller called")
|
fmt.Println("controller called")
|
||||||
},
|
},
|
||||||
|
|
35
src/cmd/getJoints.go
Normal file
35
src/cmd/getJoints.go
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Copyright © 2024 Antoine Harle antoine.harle@proton.me
|
||||||
|
|
||||||
|
*/
|
||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
// getJointsCmd represents the getJoints command
|
||||||
|
var getJointsCmd = &cobra.Command{
|
||||||
|
Use: "getJoints",
|
||||||
|
Short: "getJoints command descritpion",
|
||||||
|
Long: `getJoints command descritpion`,
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
fmt.Println("getJoints called")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
controllerCmd.AddCommand(getJointsCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// getJointsCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
// getJointsCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
}
|
|
@ -13,13 +13,8 @@ import (
|
||||||
// listenCmd represents the listen command
|
// listenCmd represents the listen command
|
||||||
var listenCmd = &cobra.Command{
|
var listenCmd = &cobra.Command{
|
||||||
Use: "listen",
|
Use: "listen",
|
||||||
Short: "A brief description of your command",
|
Short: "listen command descritpion",
|
||||||
Long: `A longer description that spans multiple lines and likely contains examples
|
Long: `listen command descritpion`,
|
||||||
and usage of using your command. For example:
|
|
||||||
|
|
||||||
Cobra is a CLI library for Go that empowers applications.
|
|
||||||
This application is a tool to generate the needed files
|
|
||||||
to quickly create a Cobra application.`,
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Println("listen called")
|
fmt.Println("listen called")
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,13 +13,8 @@ import (
|
||||||
// motorCmd represents the motor command
|
// motorCmd represents the motor command
|
||||||
var motorCmd = &cobra.Command{
|
var motorCmd = &cobra.Command{
|
||||||
Use: "motor",
|
Use: "motor",
|
||||||
Short: "A brief description of your command",
|
Short: "motor command descritpion",
|
||||||
Long: `A longer description that spans multiple lines and likely contains examples
|
Long: `motor command descritpion`,
|
||||||
and usage of using your command. For example:
|
|
||||||
|
|
||||||
Cobra is a CLI library for Go that empowers applications.
|
|
||||||
This application is a tool to generate the needed files
|
|
||||||
to quickly create a Cobra application.`,
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Println("motor called")
|
fmt.Println("motor called")
|
||||||
},
|
},
|
||||||
|
|
|
@ -13,13 +13,8 @@ import (
|
||||||
// moveVelCmd represents the moveVel command
|
// moveVelCmd represents the moveVel command
|
||||||
var moveVelCmd = &cobra.Command{
|
var moveVelCmd = &cobra.Command{
|
||||||
Use: "moveVel",
|
Use: "moveVel",
|
||||||
Short: "A brief description of your command",
|
Short: "moveVel command descritpion",
|
||||||
Long: `A longer description that spans multiple lines and likely contains examples
|
Long: `moveVel command descritpion`,
|
||||||
and usage of using your command. For example:
|
|
||||||
|
|
||||||
Cobra is a CLI library for Go that empowers applications.
|
|
||||||
This application is a tool to generate the needed files
|
|
||||||
to quickly create a Cobra application.`,
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
fmt.Println("moveVel called")
|
fmt.Println("moveVel called")
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,6 +26,7 @@ to quickly create a Cobra application.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
controllerCmd.AddCommand(serveCmd)
|
||||||
motorCmd.AddCommand(serveCmd)
|
motorCmd.AddCommand(serveCmd)
|
||||||
|
|
||||||
// Here you will define your flags and configuration settings.
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
35
src/cmd/setJoints.go
Normal file
35
src/cmd/setJoints.go
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
Copyright © 2024 Antoine Harle antoine.harle@proton.me
|
||||||
|
|
||||||
|
*/
|
||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
// setJointsCmd represents the setJoints command
|
||||||
|
var setJointsCmd = &cobra.Command{
|
||||||
|
Use: "setJoints",
|
||||||
|
Short: "setJoints command descritpion",
|
||||||
|
Long: `setJoints command descritpion`,
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
fmt.Println("setJoints called")
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
controllerCmd.AddCommand(setJointsCmd)
|
||||||
|
|
||||||
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
|
// and all subcommands, e.g.:
|
||||||
|
// setJointsCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
|
// Cobra supports local flags which will only run when this command
|
||||||
|
// is called directly, e.g.:
|
||||||
|
// setJointsCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue