mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-26 22:27:56 +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 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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue