Class EnvironmentDefaultProvider

java.lang.Object
org.projectnessie.gc.tool.cli.options.EnvironmentDefaultProvider
All Implemented Interfaces:
picocli.CommandLine.IDefaultValueProvider

public class EnvironmentDefaultProvider extends Object implements picocli.CommandLine.IDefaultValueProvider
Provides default values for command options.

Considers all "long" options (starting with --), using the conversion "NESSIE_GC_" + optionName..substring(2).replace('-', '_').toUpperCase().

For example, the default value for the command line option --jdbc-passowrd is derived from the environment variable NESSIE_GC_JDBC_PASSWORD.

  • Constructor Details

    • EnvironmentDefaultProvider

      public EnvironmentDefaultProvider()
  • Method Details

    • defaultValue

      public String defaultValue(picocli.CommandLine.Model.ArgSpec argSpec)
      Specified by:
      defaultValue in interface picocli.CommandLine.IDefaultValueProvider