mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-25 05:47:57 +02:00
service auth, edit and delete now all support --service flag
If a service name is given, this will be used. If not the user is prompted to select one.
This commit is contained in:
parent
c21715d36b
commit
9449a29fb1
9 changed files with 29 additions and 51 deletions
|
@ -34,7 +34,7 @@ var serviceEditCmd = &cobra.Command{
|
|||
Short: "Edit existing service configuration",
|
||||
Long: `Edit an existing service in the configuration file.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
service, err := cli.SelectService()
|
||||
service, err := cli.SelectService(cmd)
|
||||
cobra.CheckErr(err)
|
||||
|
||||
// Select backend
|
||||
|
@ -55,14 +55,5 @@ var serviceEditCmd = &cobra.Command{
|
|||
|
||||
func init() {
|
||||
serviceCmd.AddCommand(serviceEditCmd)
|
||||
|
||||
// Here you will define your flags and configuration settings.
|
||||
|
||||
// Cobra supports Persistent Flags which will work for this command
|
||||
// and all subcommands, e.g.:
|
||||
// serviceEditCmd.PersistentFlags().String("foo", "", "A help for foo")
|
||||
|
||||
// Cobra supports local flags which will only run when this command
|
||||
// is called directly, e.g.:
|
||||
// serviceEditCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
||||
serviceEditCmd.Flags().StringP("service", "s", "", "service configuration")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue