All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.microconfig.MicroconfigParams Maven / Gradle / Ivy

There is a newer version: 4.9.3
Show newest version
package io.microconfig;

import lombok.RequiredArgsConstructor;

import java.io.File;
import java.util.List;

@RequiredArgsConstructor
public class MicroconfigParams {
    private final CommandLineParamParser parser;

    public static MicroconfigParams parse(String... args) {
        return new MicroconfigParams(CommandLineParamParser.parse(args));
    }

    public File rootDir() {
        return new File(parser.valueOr("r", "."));
    }

    public File destinationDir() {
        return new File(parser.valueOr("d", "build"));
    }

    public String env() {
        return parser.requiredValue("e", "set -e (environment)");
    }

    public List groups() {
        return parser.listValue("g");
    }

    public List services() {
        return parser.listValue("s");
    }

    public boolean stacktrace() {
        return parser.booleanValue("stacktrace");
    }

    public boolean version() {
        return parser.contains("v");
    }

    public boolean jsonOutput() {
        return "json".equals(parser.value("output"));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy