mirror of
https://github.com/kopia/kopia.git
synced 2026-01-29 00:33:24 -05:00
25 lines
500 B
Go
25 lines
500 B
Go
package cli
|
|
|
|
import "gopkg.in/alecthomas/kingpin.v2"
|
|
|
|
var (
|
|
vaultRemoveCommand = vaultCommands.Command("rm", "Remove vault items").Hidden()
|
|
vaultRemoveItems = vaultRemoveCommand.Arg("item", "Items to remove").Strings()
|
|
)
|
|
|
|
func init() {
|
|
vaultRemoveCommand.Action(removeVaultItem)
|
|
}
|
|
|
|
func removeVaultItem(context *kingpin.ParseContext) error {
|
|
conn := mustOpenConnection()
|
|
|
|
for _, v := range *vaultRemoveItems {
|
|
if err := conn.Vault.Remove(v); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
return nil
|
|
}
|