11import click
2- from .version import __version__
3- from .util import OrderedGroup
4- from .commands import CloudscaleCommand , OUTPUT_FORMATS
5- from .commands .server import server
6- from .commands .server_group import server_group
2+
3+ from .commands import OUTPUT_FORMATS , CloudscaleCommand
4+ from .commands .custom_image import custom_image
75from .commands .flavor import flavor
86from .commands .floating_ip import floating_ip
97from .commands .image import image
10- from .commands .region import region
118from .commands .network import network
9+ from .commands .objects_user import objects_user
10+ from .commands .region import region
11+ from .commands .server import server
12+ from .commands .server_group import server_group
1213from .commands .subnet import subnet
1314from .commands .volume import volume
14- from .commands .objects_user import objects_user
15- from .commands .custom_image import custom_image
15+ from .util import OrderedGroup
16+ from .version import __version__
17+
1618
17- @click .group (cls = OrderedGroup , context_settings = {
18- 'help_option_names' : ['-h' , '--help' ],
19- })
20- @click .version_option (__version__ , '--version' )
21- @click .option ('--api-token' , '-a' , envvar = 'CLOUDSCALE_API_TOKEN' , help = "API token." )
22- @click .option ('--profile' , '-p' , envvar = 'CLOUDSCALE_PROFILE' , help = "Profile used in config file." )
23- @click .option ('--debug' , envvar = 'CLOUDSCALE_DEBUG' , is_flag = True , help = 'Enables debug log output.' )
24- @click .option ('--output' , '-o' , envvar = 'CLOUDSCALE_OUTPUT' , type = click .Choice (OUTPUT_FORMATS ), default = "table" , help = "Output format." , show_default = True )
25- @click .option ('--verbose' , '-v' , envvar = 'CLOUDSCALE_VERBOSE' , is_flag = True , help = 'Verbose output.' )
19+ @click .group (
20+ cls = OrderedGroup ,
21+ context_settings = {
22+ "help_option_names" : ["-h" , "--help" ],
23+ },
24+ )
25+ @click .version_option (__version__ , "--version" )
26+ @click .option ("--api-token" , "-a" , envvar = "CLOUDSCALE_API_TOKEN" , help = "API token." )
27+ @click .option (
28+ "--profile" , "-p" , envvar = "CLOUDSCALE_PROFILE" , help = "Profile used in config file."
29+ )
30+ @click .option (
31+ "--debug" , envvar = "CLOUDSCALE_DEBUG" , is_flag = True , help = "Enables debug log output."
32+ )
33+ @click .option (
34+ "--output" ,
35+ "-o" ,
36+ envvar = "CLOUDSCALE_OUTPUT" ,
37+ type = click .Choice (OUTPUT_FORMATS ),
38+ default = "table" ,
39+ help = "Output format." ,
40+ show_default = True ,
41+ )
42+ @click .option (
43+ "--verbose" , "-v" , envvar = "CLOUDSCALE_VERBOSE" , is_flag = True , help = "Verbose output."
44+ )
2645@click .pass_context
2746def cli (ctx , profile , api_token , debug , output , verbose ):
2847 ctx .obj = CloudscaleCommand (
@@ -34,14 +53,14 @@ def cli(ctx, profile, api_token, debug, output, verbose):
3453 )
3554
3655
37- cli .add_command (server )
38- cli .add_command (server_group )
39- cli .add_command (floating_ip )
56+ cli .add_command (custom_image )
4057cli .add_command (flavor )
58+ cli .add_command (floating_ip )
4159cli .add_command (image )
42- cli .add_command (region )
4360cli .add_command (network )
61+ cli .add_command (objects_user )
62+ cli .add_command (region )
63+ cli .add_command (server_group )
64+ cli .add_command (server )
4465cli .add_command (subnet )
4566cli .add_command (volume )
46- cli .add_command (objects_user )
47- cli .add_command (custom_image )
0 commit comments