feat: v0.7.3, parse args error message improvement
This commit is contained in:
@@ -1,13 +1,24 @@
|
|||||||
package me.hatter.tools.tinyencrypt;
|
package me.hatter.tools.tinyencrypt;
|
||||||
|
|
||||||
import me.hatter.tools.commons.io.RFile;
|
import me.hatter.tools.commons.io.RFile;
|
||||||
|
import me.hatter.tools.commons.log.LogTool;
|
||||||
|
import me.hatter.tools.commons.log.LogTools;
|
||||||
import picocli.CommandLine;
|
import picocli.CommandLine;
|
||||||
|
|
||||||
public class TinyEncryptArgsUtil {
|
public class TinyEncryptArgsUtil {
|
||||||
|
private static final LogTool log = LogTools.getLogTool(TinyEncryptArgsUtil.class);
|
||||||
private static final String DEFAULT_TINY_ENCRYPT_CONFIG = "~/.tinyencrypt_config.json";
|
private static final String DEFAULT_TINY_ENCRYPT_CONFIG = "~/.tinyencrypt_config.json";
|
||||||
|
|
||||||
|
|
||||||
public static TinyEncryptArgs parseTinyEncryptArgs(String[] args) {
|
public static TinyEncryptArgs parseTinyEncryptArgs(String[] args) {
|
||||||
|
try {
|
||||||
|
return innerParseTinyEncryptArgs(args);
|
||||||
|
} catch (CommandLine.UnmatchedArgumentException unmatchedArgumentException) {
|
||||||
|
log.error("Parse args failed: " + unmatchedArgumentException.getMessage());
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static TinyEncryptArgs innerParseTinyEncryptArgs(String[] args) {
|
||||||
final TinyEncryptArgs tinyEncryptArgs = new TinyEncryptArgs();
|
final TinyEncryptArgs tinyEncryptArgs = new TinyEncryptArgs();
|
||||||
final CommandLine cmd = new CommandLine(tinyEncryptArgs);
|
final CommandLine cmd = new CommandLine(tinyEncryptArgs);
|
||||||
cmd.parseArgs(args);
|
cmd.parseArgs(args);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package me.hatter.tools.tinyencrypt.config;
|
package me.hatter.tools.tinyencrypt.config;
|
||||||
|
|
||||||
public class TinyEncryptConstant {
|
public class TinyEncryptConstant {
|
||||||
public static final String VERSION = "0.7.2";
|
public static final String VERSION = "0.7.3";
|
||||||
|
|
||||||
public static final String ENC_FILE_EXT = ".tinyenc";
|
public static final String ENC_FILE_EXT = ".tinyenc";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user