Skip to content

Commit 00c5c29

Browse files
committed
[A] add --root-dir-of-data option
1 parent 1f1a869 commit 00c5c29

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/main/java/me/rainstorm/innodb/parser/options/CommandLineArgEnum.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ public enum CommandLineArgEnum {
1212
Help('h', "help", false, "打印帮助文档"),
1313
Version('v', "version", false, "打印版本号"),
1414
Verbose('V', "verbose", false, "打印更详细的信息"),
15-
SystemTableSpace('s', "system-tablespace-file", false, true, "系统表空间文件,绝对路径", "/var/lib/mysql/ibdata1"),
15+
DataDir('r', "root-dir-of-data", false, true, "数据目录,所有表空间默认在该目录下", "/var/lib/mysql"),
16+
SystemTableSpace('s', "system-tablespace-file", false, true, "系统表空间文件路径,-r 的相对路径", "ibdata1"),
1617
Database('d', "database", true, "需要分析的数据库名称"),
1718
TableName('t', "table", true, "需要分析的表名"),
1819
Page('p', "page", true, "需要分析的表空间页号,页号从 0 开始");
@@ -45,6 +46,7 @@ public enum CommandLineArgEnum {
4546
this(opt, longOpt, required, hasArg, desc, null);
4647
}
4748

49+
4850
/**
4951
* 含长选项的命令行参数
5052
*
@@ -80,7 +82,6 @@ public String getLongOpt() {
8082
}
8183
}
8284

83-
8485
public String getLongOptWithDefaultValue() {
8586
if (option.hasArg()) {
8687
return getLongOpt() + "=" + getDefaultValue();

src/main/java/me/rainstorm/innodb/parser/options/CommandLineArgsHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
@Slf4j
1414
public class CommandLineArgsHelper {
15-
private static final HelpFormatter formatter = new HelpFormatter();
15+
private static final HelpFormatter FORMATTER = new HelpFormatter();
1616

1717
private final CommandLine commandLineParsed;
1818

@@ -21,9 +21,9 @@ public CommandLineArgsHelper(String[] args) throws ParseException {
2121
}
2222

2323
public static void printHelp() {
24-
formatter.printHelp("java -jar /path/to/your/innodb-parser.jar " + requiredArg() +
24+
FORMATTER.printHelp("java -jar /path/to/your/innodb-parser.jar " + requiredArg() +
2525
" [OPTION]...\n" +
26-
"根据选项解析 Innodb 数据文件",
26+
"根据选项解析 Innodb 数据文件,目前支持系统表空间页和独立表空间部分页的分析,具体说明请查看 README",
2727
"====================================",
2828
CommandLineArgEnum.getOptions(),
2929
"====================================\n如有问题,可以联系 pom.xml 中的开发者");

0 commit comments

Comments
 (0)