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 serviceDeleteCmd = &cobra.Command{
Short: "Delete existing service configuration",
Long: `Delete an existing service from the configuration file.`,
Run: func(cmd *cobra.Command, args []string) {
service, err := cli.SelectService()
service, err := cli.SelectService(cmd)
cobra.CheckErr(err)
// Prompt for deletion
@ -58,14 +58,5 @@ var serviceDeleteCmd = &cobra.Command{
func init() {
serviceCmd.AddCommand(serviceDeleteCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// serviceDeleteCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// serviceDeleteCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
serviceDeleteCmd.Flags().StringP("service", "s", "", "service configuration")
}