public static Map < String , String > fromPosixArray ( Iterable < String > args ) { Map < String , String > kvMap = Maps . newHashMap ( ) ; for ( String arg : args ) { kvMap . putAll ( Splitter . on ( "--" ) . omitEmptyStrings ( ) . trimResults ( ) . withKeyValueSeparator ( "=" ) . split ( arg ) ) ; } return kvMap ; }
Converts a POSIX compliant program argument array to a String - to - String Map .