@@ -6,7 +6,7 @@ package cli
6
6
7
7
var cmdIPS = & Command {
8
8
Exec : runIPS ,
9
- UsageLine : "_ips [--new|--attach|--delete ] [IP_ID [SERVER_ID]]" ,
9
+ UsageLine : "_ips [OPTIONS ] [IP_ID [SERVER_ID]]" ,
10
10
11
11
Description : "Interacts with your IPs" ,
12
12
Hidden : true ,
@@ -17,19 +17,22 @@ var cmdIPS = &Command{
17
17
$ scw _ips --new
18
18
$ scw _ips --attach IP_ID SERVER_ID
19
19
$ scw _ips --delete IP_ID
20
+ $ scw _ips --detach IP_ID
20
21
` ,
21
22
}
22
23
23
24
func init () {
24
25
cmdIPS .Flag .BoolVar (& ipHelp , []string {"h" , "-help" }, false , "Print usage" )
25
26
cmdIPS .Flag .BoolVar (& ipNew , []string {"n" , "-new" }, false , "Add a new IP" )
26
27
cmdIPS .Flag .BoolVar (& ipAttach , []string {"a" , "-attach" }, false , "Attach an IP to a server" )
28
+ cmdIPS .Flag .BoolVar (& ipDetach , []string {"-detach" }, false , "Detach an IP from a server" )
27
29
cmdIPS .Flag .StringVar (& ipDelete , []string {"d" , "-delete" }, "" , "Detele an IP" )
28
30
}
29
31
30
32
var ipHelp bool // -h, --help flag
31
33
var ipNew bool // -n, --new flag
32
34
var ipAttach bool // -a, --attach flag
35
+ var ipDetach bool // --detach flag
33
36
var ipDelete string // -d, --delete flag
34
37
35
38
func runIPS (cmd * Command , args []string ) error {
@@ -53,6 +56,9 @@ func runIPS(cmd *Command, args []string) error {
53
56
}
54
57
return cmd .API .AttachIP (args [0 ], args [1 ])
55
58
}
59
+ if ipDetach {
60
+ return cmd .API .DetachIP (args [0 ])
61
+ }
56
62
if len (args ) == 1 {
57
63
ip , err := cmd .API .GetIP (args [0 ])
58
64
if err != nil {
0 commit comments