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:
Philipp Wolfer 2023-12-09 22:59:33 +01:00
parent c21715d36b
commit 9449a29fb1
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
9 changed files with 29 additions and 51 deletions

View file

@ -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")
}