@@ -60,12 +60,7 @@ public abstract class AbstractClusterCommand extends Command {
60
60
61
61
protected OptionParser parser = new OptionParser ();
62
62
private Map <Property , OptionSpec <?>> optionSpecs ;
63
- private OptionSpec <String > configOption = parser
64
- .accepts ("config" , "Note that Whirr properties specified in " +
65
- "this file should all have a whirr. prefix." )
66
- .withRequiredArg ()
67
- .describedAs ("config.properties" )
68
- .ofType (String .class );
63
+ private OptionSpec <String > configOption ;
69
64
70
65
public AbstractClusterCommand (String name , String description , ClusterControllerFactory factory ) {
71
66
this (name , description , factory , new ClusterStateStoreFactory ());
@@ -75,6 +70,14 @@ public AbstractClusterCommand(String name, String description, ClusterController
75
70
ClusterStateStoreFactory stateStoreFactory ) {
76
71
super (name , description );
77
72
73
+ configOption = parser .accepts ("config" , "Note that Whirr properties specified in " +
74
+ "this file should all have a whirr. prefix." )
75
+ .withRequiredArg ()
76
+ .describedAs ("config.properties" )
77
+ .ofType (String .class );
78
+
79
+ parser .accepts ("quiet" , "Be less verbose" );
80
+
78
81
this .factory = factory ;
79
82
this .stateStoreFactory = stateStoreFactory ;
80
83
@@ -156,6 +159,13 @@ protected ClusterStateStore createClusterStateStore(ClusterSpec spec) {
156
159
return stateStoreFactory .create (spec );
157
160
}
158
161
162
+ protected void printProviderInfo (PrintStream out , PrintStream err ,
163
+ ClusterSpec clusterSpec , OptionSet optionSet ) {
164
+ if (!optionSet .has ("quiet" )) {
165
+ out .println (String .format ("Running on provider %s using identity %s" , clusterSpec .getProvider (), clusterSpec .getIdentity ()));
166
+ }
167
+ }
168
+
159
169
/**
160
170
* Print command execution error and a hint to help the user get more help
161
171
*/
0 commit comments