Class EnvironmentCommand<T extends Configuration>

    • Constructor Detail

      • EnvironmentCommand

        protected EnvironmentCommand​(Application<T> application,
                                     String name,
                                     String description)
        Creates a new environment command.
        Parameters:
        application - the application providing this command
        name - the name of the command, used for command line invocation
        description - a description of the command's purpose
    • Method Detail

      • getEnvironment

        public @Nullable Environment getEnvironment()
        Returns the constructed environment or null if it hasn't been constructed yet.
        Returns:
        Returns the constructed environment or null if it hasn't been constructed yet
        Since:
        2.0.19
      • run

        protected abstract void run​(Environment environment,
                                    net.sourceforge.argparse4j.inf.Namespace namespace,
                                    T configuration)
                             throws Exception
        Runs the command with the given Environment and Configuration.
        Parameters:
        environment - the configured environment
        namespace - the parsed command line namespace
        configuration - the configuration object
        Throws:
        Exception - if something goes wrong