You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a tool that launches clusters in a choice of different cloud providers like AWS EC2 and Google Compute Engine. Each cloud provider has options specific to it, but there are also options not specific to any provider.
To illustrate, here's a rough example of what I'm imagining the --help text for the tool will look like:
Basically, acme-launcher has some top-level options. Then, depending on what --provider is chosen -- ec2 or gce -- different options for the launch sub-command become available. As noted earlier, there are some options like --install-ganglia that apply regardless of the chosen provider.
I'm thinking the launch command will map to a Python function which will process some of the top-level options like --provider. Then, depending on the chosen provider, it will dispatch to the appropriate sub-command function (launch_ec2, launch_gce, etc.) to continue the job.
From a command-line UI perspective, I think this is roughly how Docker Machine works. Docker Machine will launch any kind of resource you specify -- a VM, EC2 instance, GCE instance, etc. -- and, depending on the chosen resource provider, accept additional options.
Is this kind of CLI design a good idea for this situation? And, more to the point of this project, can it be done in Click?
The text was updated successfully, but these errors were encountered:
I ended up just exposing all the provider-specific options all the time, and just doing run-time checks to ignore or error out when the wrong options are used.
I'm writing a tool that launches clusters in a choice of different cloud providers like AWS EC2 and Google Compute Engine. Each cloud provider has options specific to it, but there are also options not specific to any provider.
To illustrate, here's a rough example of what I'm imagining the
--help
text for the tool will look like:Basically,
acme-launcher
has some top-level options. Then, depending on what--provider
is chosen --ec2
orgce
-- different options for thelaunch
sub-command become available. As noted earlier, there are some options like--install-ganglia
that apply regardless of the chosen provider.I'm thinking the
launch
command will map to a Python function which will process some of the top-level options like--provider
. Then, depending on the chosen provider, it will dispatch to the appropriate sub-command function (launch_ec2
,launch_gce
, etc.) to continue the job.From a command-line UI perspective, I think this is roughly how Docker Machine works. Docker Machine will launch any kind of resource you specify -- a VM, EC2 instance, GCE instance, etc. -- and, depending on the chosen resource provider, accept additional options.
Is this kind of CLI design a good idea for this situation? And, more to the point of this project, can it be done in Click?
The text was updated successfully, but these errors were encountered: