Skip to content

Commit

Permalink
use update instead of modify to conform with docker API
Browse files Browse the repository at this point in the history
  • Loading branch information
mhewedy committed Jun 18, 2020
1 parent 77cf4e2 commit 18a1db3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ Available Commands:
help Help about any command
images List remote and cached images
ip Show IP address for a running VM
modify Modify a VM HW specs (cpus, memory)
mount Mount local filesystem inside the VM
port Forward port(s) from a VM to host
ps List VMs
Expand All @@ -103,6 +102,7 @@ Available Commands:
start Start one or more stopped VMs
stop Stop one or more running VMs
tag Add or remove tag to a VM
update Update configuration of a VM
Flags:
-h, --help help for vermin
Expand Down
21 changes: 11 additions & 10 deletions cmd/modify.go → cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ import (
"os"
)

// modifyCmd represents the modify command
var modifyCmd = &cobra.Command{
Use: "modify",
Short: "Modify a VM HW specs (cpus, memory)",
Long: "Modify a VM HW specs (cpus, memory)",
// updateCmd represents the update command
var updateCmd = &cobra.Command{
Use: "update",
Aliases: []string{"modify"},
Short: "Update configuration of a VM",
Long: "Update configuration of a VM",
Example: `
To change the VM to use 2 cores and 512MB memory
$ vermin modify vm_01 --cpus 2 --mem 512
$ vermin update vm_01 --cpus 2 --mem 512
`,
Run: func(cmd *cobra.Command, args []string) {
vmName := args[0]
Expand Down Expand Up @@ -65,16 +66,16 @@ $ vermin modify vm_01 --cpus 2 --mem 512
}

func init() {
rootCmd.AddCommand(modifyCmd)
rootCmd.AddCommand(updateCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// modifyCmd.PersistentFlags().String("foo", "", "A help for foo")
// updateCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
modifyCmd.Flags().IntP("cpus", "c", 0, "Number of cpu cores")
modifyCmd.Flags().IntP("mem", "m", 0, "Memory size in mega bytes")
updateCmd.Flags().IntP("cpus", "c", 0, "Number of cpu cores")
updateCmd.Flags().IntP("mem", "m", 0, "Memory size in mega bytes")
}

0 comments on commit 18a1db3

Please sign in to comment.