feat(stores): adds mvs, and flags to bring store commands on par with key commands
This commit is contained in:
parent
b89db8dc48
commit
4e5064d07a
25 changed files with 247 additions and 9 deletions
|
|
@ -60,8 +60,12 @@ func delStore(cmd *cobra.Command, args []string) error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("cannot delete store '%s': %v", dbName, err)
|
||||
}
|
||||
yes, err := cmd.Flags().GetBool("yes")
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot delete store '%s': %v", dbName, err)
|
||||
}
|
||||
|
||||
if interactive || config.Store.AlwaysPromptDelete {
|
||||
if !yes && (interactive || config.Store.AlwaysPromptDelete) {
|
||||
promptf("delete store '%s'? (y/n)", args[0])
|
||||
|
||||
var confirm string
|
||||
|
|
@ -87,5 +91,6 @@ func executeDeletion(path string) error {
|
|||
|
||||
func init() {
|
||||
delStoreCmd.Flags().BoolP("interactive", "i", false, "Prompt yes/no for each deletion")
|
||||
delStoreCmd.Flags().BoolP("yes", "y", false, "Skip all confirmation prompts")
|
||||
rootCmd.AddCommand(delStoreCmd)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue