@@ -22,6 +22,7 @@ var cmdCreate = &Command{
2222 $ scw create --bootscript=3.2.34 --env="boot=live rescue_image=http://j.mp/scaleway-ubuntu-trusty-tarball" 50GB
2323 $ scw inspect $(scw create 1GB --bootscript=rescue --volume=50GB)
2424 $ scw create $(scw tag my-snapshot my-image)
25+ $ scw create --tmp-ssh-key 10GB
2526` ,
2627}
2728
@@ -31,6 +32,7 @@ func init() {
3132 cmdCreate .Flag .StringVar (& createEnv , []string {"e" , "-env" }, "" , "Provide metadata tags passed to initrd (i.e., boot=resue INITRD_DEBUG=1)" )
3233 cmdCreate .Flag .StringVar (& createVolume , []string {"v" , "-volume" }, "" , "Attach additional volume (i.e., 50G)" )
3334 cmdCreate .Flag .BoolVar (& createHelp , []string {"h" , "-help" }, false , "Print usage" )
35+ cmdCreate .Flag .BoolVar (& createTmpSSHKey , []string {"-tmp-ssh-key" }, false , "Access your server without uploading your SSH key to your account" )
3436}
3537
3638// Flags
@@ -39,6 +41,7 @@ var createBootscript string // --bootscript flag
3941var createEnv string // -e, --env flag
4042var createVolume string // -v, --volume flag
4143var createHelp bool // -h, --help flag
44+ var createTmpSSHKey bool // --tmp-ssh-key flag
4245
4346func runCreate (cmd * Command , rawArgs []string ) {
4447 if createHelp {
@@ -51,9 +54,15 @@ func runCreate(cmd *Command, rawArgs []string) {
5154 args := commands.CreateArgs {
5255 Name : createName ,
5356 Bootscript : createBootscript ,
54- Tags : strings .Split (createEnv , " " ),
55- Volumes : strings .Split (createVolume , " " ),
5657 Image : rawArgs [0 ],
58+ TmpSSHKey : createTmpSSHKey ,
59+ }
60+
61+ if len (runCreateEnv ) > 0 {
62+ args .Tags = strings .Split (runCreateEnv , " " )
63+ }
64+ if len (runCreateVolume ) > 0 {
65+ args .Volumes = strings .Split (runCreateVolume , " " )
5766 }
5867 ctx := cmd .GetContext (rawArgs )
5968 err := commands .RunCreate (ctx , args )
0 commit comments