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

com.hibegin.common.util.ParseArgsUtil Maven / Gradle / Ivy

Go to download

Simple, flexible, less dependent, more extended. Less memory footprint, can quickly build Web project. Can quickly run embedded, Android devices

There is a newer version: 0.3.162
Show newest version
package com.hibegin.common.util;

public class ParseArgsUtil {

    public static boolean justTips(String[] args, String processName, String version) {
        if (args.length > 0) {
            switch (args[0]) {
                case "-v":
                case "--version":
                    System.out.println(processName + " version: " + version);
                    return true;
                case "--properties":
                    System.getProperties().forEach((key, value) -> System.out.format("%s=%s%n", key, value));
                    return true;
                case "--env":
                    System.getenv().forEach((key, value) -> System.out.format("%s=%s%n", key, value));
                    return true;
            }
        }
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy