/** * Declares a new CLI option, associating it with a config path. The option runtime value is assigned to the * configuration property denoted by the path. * * @param configPath a dot-separated "path" that navigates configuration tree to the desired property. E.g. * "jdbc.myds.password". * @param name the name of the new CLI option. * @return this extender instance * @since 0.24 */ public BQCoreModuleExtender addOption(String configPath, String name) { contributeOptions().addBinding().toInstance( OptionMetadata.builder(name) .configPath(configPath) .valueRequired() .build()); return this; }
@Override protected void configure() { // Binding a dummy class to trigger eager init of Log4j as // @Provides below can not be invoked eagerly. binder().bind(LogInitTrigger.class).asEagerSingleton(); VariableDecls.extend(binder()).declareVar(LEVEL); extend(binder()).addOption(OptionMetadata.builder( "log", //$NON-NLS-1$ Locale.getString("LOG_OPT", Level.getLabels())) //$NON-NLS-1$ .configPath(LEVEL) .valueRequired(Locale.getString("LEVEL")) //$NON-NLS-1$ .build()); }
Path.fromPortableString(SARLConfig.FOLDER_SOURCE_GENERATED).toFile().getPath())) .configPath(OUTPUT_PATH_NAME) .valueRequired(Messages.SarlcConfigModule_1) .build()); Path.fromPortableString(SARLConfig.FOLDER_BIN).toFile().getPath())) .configPath(CLASS_OUTPUT_PATH_NAME) .valueRequired(Messages.SarlcConfigModule_1) .build()); "workingdir", Messages.SarlcConfigModule_2) //$NON-NLS-1$ .configPath(WORKING_PATH_NAME) .valueRequired(Messages.SarlcConfigModule_1) .build()); CLASSPATH_LONG_OPTION, cpDescription) .configPath(CLASSPATH_NAME) .valueRequired(Messages.SarlcConfigModule_4) .build(), OptionMetadata.builder( CLASSPATH_SHORT_OPTION, cpDescription) .configPath(CLASSPATH_NAME) .valueRequired(Messages.SarlcConfigModule_4) .build()); MessageFormat.format(Messages.SarlcConfigModule_5, File.pathSeparator)) .configPath(BOOT_CLASSPATH_NAME) .valueRequired(Messages.SarlcConfigModule_4) .build());
public Builder valueRequired() { return valueRequired(""); }
OptionMetadata createConfigOption() { return OptionMetadata .builder(CliConfigurationSource.CONFIG_OPTION, "Specifies YAML config location, which can be a file path or a URL.") .valueRequired("yaml_location").build(); }
public Builder valueRequired() { return valueRequired(""); }
OptionMetadata createConfigOption() { return OptionMetadata .builder(CliConfigurationSource.CONFIG_OPTION, "Specifies YAML config location, which can be a file path or a URL.") .valueRequired("yaml_location").build(); }