mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-18 11:09:29 +02:00
Renamed config command to service, make auth a subcommand
This commit is contained in:
parent
9c363cc06d
commit
c6c0723e27
3 changed files with 8 additions and 10 deletions
|
@ -80,7 +80,7 @@ var addCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
configCmd.AddCommand(addCmd)
|
serviceCmd.AddCommand(addCmd)
|
||||||
|
|
||||||
// Here you will define your flags and configuration settings.
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@ import (
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// authCmd represents the auth command
|
|
||||||
var authCmd = &cobra.Command{
|
var authCmd = &cobra.Command{
|
||||||
Use: "auth",
|
Use: "auth",
|
||||||
Short: "Authenticate with a backend",
|
Short: "Authenticate with a backend",
|
||||||
|
@ -92,7 +91,7 @@ var authCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(authCmd)
|
serviceCmd.AddCommand(authCmd)
|
||||||
|
|
||||||
authCmd.Flags().StringP("service", "s", "", "Service configuration (required)")
|
authCmd.Flags().StringP("service", "s", "", "Service configuration (required)")
|
||||||
authCmd.MarkFlagRequired("service")
|
authCmd.MarkFlagRequired("service")
|
||||||
|
|
|
@ -25,24 +25,23 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
// configCmd represents the config command
|
var serviceCmd = &cobra.Command{
|
||||||
var configCmd = &cobra.Command{
|
Use: "service",
|
||||||
Use: "config",
|
Short: "Manage the service configuration",
|
||||||
Short: "Manage the configuration",
|
|
||||||
Long: `Manage the scotty configuration using the subcommands to add, remove
|
Long: `Manage the scotty configuration using the subcommands to add, remove
|
||||||
or edit services.`,
|
or edit services.`,
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(configCmd)
|
rootCmd.AddCommand(serviceCmd)
|
||||||
|
|
||||||
// Here you will define your flags and configuration settings.
|
// Here you will define your flags and configuration settings.
|
||||||
|
|
||||||
// Cobra supports Persistent Flags which will work for this command
|
// Cobra supports Persistent Flags which will work for this command
|
||||||
// and all subcommands, e.g.:
|
// and all subcommands, e.g.:
|
||||||
// configCmd.PersistentFlags().String("foo", "", "A help for foo")
|
// serviceCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||||
|
|
||||||
// Cobra supports local flags which will only run when this command
|
// Cobra supports local flags which will only run when this command
|
||||||
// is called directly, e.g.:
|
// is called directly, e.g.:
|
||||||
// configCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
// serviceCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue