Refactor to reduce diff
@@ -1135,7 +1135,7 @@ fn config_file_to_defaults(config_file: &str)
}
pub fn sub_sup_run(feature_flags: FeatureFlag) -> App<'static, 'static> {
- let sub = if feature_flags.contains(FeatureFlag::CONFIG_FILE) {
+ if feature_flags.contains(FeatureFlag::CONFIG_FILE) {
// Construct a `clap::App` from the `structopt` decorated struct.
let mut sub = SubSupRun::clap();
if let Ok(config_file) = env::var("HAB_FEAT_CONFIG_FILE") {
@@ -1151,9 +1151,10 @@ pub fn sub_sup_run(feature_flags: FeatureFlag) -> App<'static, 'static> {
Err(e) => error!("Failed to parse config file, err: {}", e),
}
}
- sub
- } else {
- clap_app!(@subcommand run =>
+ let sub = add_event_stream_options(sub);
+ return add_shutdown_timeout_option(sub);
+ }
+ let sub = clap_app!(@subcommand run =>
(about: "Run the Habitat Supervisor")
// set custom usage string, otherwise the binary
// is displayed confusingly as `hab-sup`
@@ -1243,8 +1244,8 @@ pub fn sub_sup_run(feature_flags: FeatureFlag) -> App<'static, 'static> {
argument is not set, the supervisor tries to dynamically determine \
an IP address. If that fails, the supervisor defaults to using \
`127.0.0.1`")
- )
- };
+ );
+
let sub = add_event_stream_options(sub);
add_shutdown_timeout_option(sub)
}
