@@ -73,35 +73,28 @@ def get_version_message(ctx, param, value):
7373 epilog = """Run 'islcli login' to authenticate""" ,
7474 cls = CommandLoader ,
7575 context_settings = CONTEXT_SETTINGS )
76- @click .option ('--format' ,
77- default = DEFAULT_FORMAT ,
78- show_default = True ,
76+ @click .option ('--format' , default = DEFAULT_FORMAT , show_default = True ,
7977 help = "Output format" ,
8078 type = click .Choice (VALID_FORMATS ))
81- @click .option ('-C' , '--config' ,
82- required = False ,
79+ @click .option ('-C' , '--config' , required = False , show_default = True ,
8380 default = click .get_app_dir ('softlayer' , force_posix = True ),
84- show_default = True ,
8581 help = "Config file location" ,
8682 type = click .Path (resolve_path = True ))
8783@click .option ('--verbose' , '-v' ,
8884 help = "Sets the debug noise level, specify multiple times for more verbosity." ,
8985 type = click .IntRange (0 , 3 , clamp = True ),
9086 count = True )
91- @click .option ('--proxy' ,
92- required = False ,
87+ @click .option ('--proxy' , required = False ,
9388 help = "HTTPS or HTTP proxy to be use to make API calls" )
94- @click .option ('--really / --not-really' , '-y' ,
95- is_flag = True ,
96- required = False ,
89+ @click .option ('--really / --not-really' , '-y' , is_flag = True , required = False ,
9790 help = "Confirm all prompt actions" )
98- @click .option ('--demo / --no-demo' ,
99- is_flag = True ,
100- required = False ,
91+ @click .option ('--demo / --no-demo' , is_flag = True , required = False ,
10192 help = "Use demo data instead of actually making API calls" )
10293@click .option ('--version' , is_flag = True , expose_value = False , is_eager = True , callback = get_version_message ,
10394 help = "Show version information." , allow_from_autoenv = False ,)
104- @click .option ('--account' , '-a' , help = "Account Id" )
95+ @click .option ('--account' , '-a' , help = "Account Id, only needed for some API calls." )
96+ @click .option ('--internal' , '-i' , is_flag = True , required = False ,
97+ help = "Use the Employee Client instead of the Customer Client." )
10598@environment .pass_env
10699def cli (env ,
107100 format = 'table' ,
@@ -111,6 +104,7 @@ def cli(env,
111104 really = False ,
112105 demo = False ,
113106 account = None ,
107+ internal = False ,
114108 ** kwargs ):
115109 """Main click CLI entry-point."""
116110
@@ -119,7 +113,10 @@ def cli(env,
119113 env .config_file = config
120114 env .format = format
121115 env .set_env_theme (config_file = config )
122- env .ensure_client (config_file = config , is_demo = demo , proxy = proxy )
116+ if internal :
117+ env .ensure_emp_client (config_file = config , is_demo = demo , proxy = proxy )
118+ else :
119+ env .ensure_client (config_file = config , is_demo = demo , proxy = proxy )
123120 env .vars ['_start' ] = time .time ()
124121 logger = logging .getLogger ()
125122
@@ -134,7 +131,6 @@ def cli(env,
134131 env .vars ['_timings' ] = SoftLayer .DebugTransport (env .client .transport )
135132 env .vars ['verbose' ] = verbose
136133 env .client .transport = env .vars ['_timings' ]
137- print ("Account ID is now: {}" .format (account ))
138134 env .client .account_id = account
139135
140136
0 commit comments