/** * 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. Default value provided here will be used if the option is present, * but no value is specified on the command line. * * @param configPath a dot-separated "path" that navigates configuration tree to the desired property. E.g. * "jdbc.myds.password". * @param defaultValue default option value * @param name the name of the new CLI option. * @return this extender instance * @since 0.24 */ public BQCoreModuleExtender addOption(String configPath, String defaultValue, String name) { contributeOptions().addBinding().toInstance( OptionMetadata.builder(name) .configPath(configPath) .defaultValue(defaultValue) .valueOptional() .build()); return this; }
.configPath(FILE_ENCODING_NAME) .valueOptional(Messages.CompilerConfigModule_1) .defaultValue(Charset.defaultCharset().displayName()) .build()); .configPath(JAVA_VERSION_NAME) .valueOptional(Messages.CompilerConfigModule_3) .defaultValue(SARLVersion.MINIMAL_JDK_VERSION) .build()); .configPath(JAVA_COMPILER_NAME) .valueOptional(jcompilerValues) .defaultValue(JavaCompiler.getDefault().toJsonString()) .build()); .configPath(OUTPUT_TRACES_NAME) .valueOptional(trueFalseValues) .defaultValue(Boolean.TRUE.toString()) .build()); .configPath(OUTPUT_STORAGES_NAME) .valueOptional(trueFalseValues) .defaultValue(Boolean.TRUE.toString()) .build()); .configPath(GENERATE_INLINES_NAME) .valueOptional(trueFalseValues) .defaultValue(Boolean.toString(GeneratorConfig2.DEFAULT_GENERATE_INLINE_ANNOTATION)) .build());
@Override protected void configure() { extend(binder()) .addOption(OptionMetadata.builder( CompilerCommand.PROGRESS_OPTION_NAME, Messages.CompilerCommandModule_0) .configPath(ProgressBarConfig.ENABLE) .defaultValue(Boolean.TRUE.toString()) .build()); extend(binder()).addCommand(CompilerCommand.class); binder().bindListener(new BindingMatcher(), new LoggerProvisionListener( binder().getProvider(ProgressBarConfig.class))); }