From 38266af66eecd67831f805e9e3696ec8ad47a772 Mon Sep 17 00:00:00 2001 From: yo Date: Sun, 25 Sep 2022 13:45:40 +0200 Subject: [PATCH] Version 0.29f + WIP: gocage destroy --- cmd/root.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 21aa4b0..398884d 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -14,7 +14,7 @@ import ( ) const ( - gVersion = "0.29f" + gVersion = "0.29g" // TODO : Get from $jail_zpool/defaults.json MIN_DYN_DEVFS_RULESET = 1000 @@ -26,6 +26,7 @@ var ( gDatastores []Datastore gUseSudo bool + gForce bool gConfigFile string gDisplayJColumns string @@ -90,7 +91,17 @@ ex: gocage list srv-db srv-web`, ListJailsProps(args) }, } - + +/* destroyCmd = &cobra.Command{ + Use: "destroy", + Short: "destroy jails", + Long: `Destroy jail filesystem, snapshots and configuration file.`, + Run: func(cmd *cobra.Command, args []string) { + ListJails(args, false) + DestroyJails(args) + }, + } +*/ stopCmd = &cobra.Command{ Use: "stop", Short: "stop jail", @@ -290,6 +301,8 @@ func init() { listCmd.Flags().BoolVarP(&gNoJailLineSep, "nolinesep", "l", false, "Do not display line separator between jails") listCmd.Flags().StringVarP(&gFilterJails, "filter", "f", "none", "Only display jails with these values. Ex: \"gocage list -f Config.Boot=1\" will only list started on boot jails") listCmd.Flags().StringVarP(&gSortJailFields, "sort", "s", "none", "Display jails sorted by field values. Ex: \"gocage list -s +Name,-Config.Priority\" will sort jails by their decreasing name, then increasing start priority. 3 critera max supported.") + +// destroyCmd.Flags().BoolVarP(&gForce, "force", "f", false, "Force stop jail if running") snapshotListCmd.Flags().StringVarP(&gDisplaySColumns, "outcol", "o", "Jailname,Name,Creation,Referenced,Used", "Show these columns in output") snapshotListCmd.Flags().BoolVarP(&gNoSnapLineSep, "nolinesep", "l", false, "Do not display line separator between snapshots") @@ -320,6 +333,7 @@ func init() { rootCmd.AddCommand(stopCmd) rootCmd.AddCommand(startCmd) rootCmd.AddCommand(restartCmd) +// rootCmd.AddCommand(destroyCmd) rootCmd.AddCommand(shellCmd) rootCmd.AddCommand(getCmd) rootCmd.AddCommand(setCmd)