@@ -9,19 +9,19 @@ import (
99 "github.com/bensallen/hkmgr/internal/config"
1010 "github.com/bensallen/hkmgr/internal/console"
1111 "github.com/bensallen/hkmgr/internal/destroy"
12+ "github.com/bensallen/hkmgr/internal/down"
1213 "github.com/bensallen/hkmgr/internal/ssh"
13- start "github.com/bensallen/hkmgr/internal/start"
1414 "github.com/bensallen/hkmgr/internal/status"
15- stop "github.com/bensallen/hkmgr/internal/stop "
15+ "github.com/bensallen/hkmgr/internal/up "
1616 "github.com/integrii/flaggy"
1717 "github.com/kr/pretty"
1818)
1919
2020var version = "unknown"
2121
2222func Run () error {
23- var startSubcommand * flaggy.Subcommand
24- var stopSubcommand * flaggy.Subcommand
23+ var upSubcommand * flaggy.Subcommand
24+ var downSubcommand * flaggy.Subcommand
2525 var destroySubcommand * flaggy.Subcommand
2626 var validateSubcommand * flaggy.Subcommand
2727 var sshSubcommand * flaggy.Subcommand
@@ -42,15 +42,15 @@ func Run() error {
4242 flaggy .Bool (& debug , "d" , "debug" , "Enable debug output" )
4343 flaggy .Bool (& dryRun , "n" , "dry-run" , "Don't execute any commands that affect change, just show what will be run" )
4444
45- startSubcommand = flaggy .NewSubcommand ("start " )
46- startSubcommand .Description = "Start VMs"
47- startSubcommand .AddPositionalValue (& vmName , "name" , 1 , false , "Specify a VM, otherwise all VMs will be run" )
45+ upSubcommand = flaggy .NewSubcommand ("up " )
46+ upSubcommand .Description = "Start VMs"
47+ upSubcommand .AddPositionalValue (& vmName , "name" , 1 , false , "Specify a VM, otherwise all VMs will be run" )
4848
49- stopSubcommand = flaggy .NewSubcommand ("stop " )
50- stopSubcommand .Description = "Stop VMs"
51- var stopSignal string
52- stopSubcommand .String (& stopSignal , "s" , "signal" , "Signal to send to VM" )
53- stopSubcommand .AddPositionalValue (& vmName , "name" , 1 , false , "Specify a VM, otherwise all VMs will be stopped" )
49+ downSubcommand = flaggy .NewSubcommand ("down " )
50+ downSubcommand .Description = "Stop VMs"
51+ var downSignal string
52+ downSubcommand .String (& downSignal , "s" , "signal" , "Signal to send to VM" )
53+ downSubcommand .AddPositionalValue (& vmName , "name" , 1 , false , "Specify a VM, otherwise all VMs will be stopped" )
5454
5555 destroySubcommand = flaggy .NewSubcommand ("destroy" )
5656 destroySubcommand .Description = "Destroy VMs"
@@ -72,8 +72,8 @@ func Run() error {
7272 consoleSubcommand .Description = "Open Console of VM"
7373 consoleSubcommand .AddPositionalValue (& vmName , "name" , 1 , true , "Specify a VM" )
7474
75- flaggy .AttachSubcommand (startSubcommand , 1 )
76- flaggy .AttachSubcommand (stopSubcommand , 1 )
75+ flaggy .AttachSubcommand (upSubcommand , 1 )
76+ flaggy .AttachSubcommand (downSubcommand , 1 )
7777 //flaggy.AttachSubcommand(destroySubcommand, 1)
7878 //flaggy.AttachSubcommand(validateSubcommand, 1)
7979 flaggy .AttachSubcommand (statusSubcommand , 1 )
@@ -113,12 +113,12 @@ func Run() error {
113113 }
114114
115115 switch {
116- case startSubcommand .Used :
117- if err := start .Run (& config , vmName , debug , dryRun ); err != nil {
116+ case upSubcommand .Used :
117+ if err := up .Run (& config , vmName , debug , dryRun ); err != nil {
118118 return err
119119 }
120- case stopSubcommand .Used :
121- if err := stop .Run (& config , vmName , stopSignal ); err != nil {
120+ case downSubcommand .Used :
121+ if err := down .Run (& config , vmName , downSignal ); err != nil {
122122 return err
123123 }
124124 case destroySubcommand .Used :
0 commit comments