|
|
@ -33,9 +33,10 @@ var forgetCmd = &cobra.Command{
|
|
|
|
selected, err := internal.GetAllOrSelected(cmd, false)
|
|
|
|
selected, err := internal.GetAllOrSelected(cmd, false)
|
|
|
|
cobra.CheckErr(err)
|
|
|
|
cobra.CheckErr(err)
|
|
|
|
prune, _ := cmd.Flags().GetBool("prune")
|
|
|
|
prune, _ := cmd.Flags().GetBool("prune")
|
|
|
|
|
|
|
|
dry, _ := cmd.Flags().GetBool("dry-run")
|
|
|
|
for _, name := range selected {
|
|
|
|
for _, name := range selected {
|
|
|
|
location := config.Locations[name]
|
|
|
|
location := config.Locations[name]
|
|
|
|
err := location.Forget(prune)
|
|
|
|
err := location.Forget(prune, dry)
|
|
|
|
cobra.CheckErr(err)
|
|
|
|
cobra.CheckErr(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -46,4 +47,5 @@ func init() {
|
|
|
|
rootCmd.AddCommand(forgetCmd)
|
|
|
|
rootCmd.AddCommand(forgetCmd)
|
|
|
|
internal.AddFlagsToCommand(forgetCmd, false)
|
|
|
|
internal.AddFlagsToCommand(forgetCmd, false)
|
|
|
|
forgetCmd.Flags().Bool("prune", false, "Also prune repository")
|
|
|
|
forgetCmd.Flags().Bool("prune", false, "Also prune repository")
|
|
|
|
|
|
|
|
forgetCmd.Flags().Bool("dry-run", false, "Do not write changes, show what would be affected")
|
|
|
|
}
|
|
|
|
}
|
|
|
|