/*
* Meviz - Various tools collection to work with multimedia.
- * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Copyright (C) 2012 -- 2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public License
- * as published by the Free Software Foundation.
- */
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+*/
package eu.svjatoslav.meviz.bomremove;
import java.io.File;
-public class CommandlineHandler {
+class CommandlineHandler {
- Parser parser = new Parser();
+ final Parser parser = new Parser();
- NullParameter recursiveParameter = parser.add(
+ private final NullParameter recursiveParameter = parser.add(
new NullParameter("Enable recursive mode.")).addAliases("-r",
"--recursive");
- StringParameters inputPatternParameter = parser.add(
+ private final StringParameters inputPatternParameter = parser.add(
new StringParameters("File input pattern.")).addAliases("-i",
"--input-pattern");
- DirectoryParameter workingDirectoryParameter = parser
+ private final DirectoryParameter workingDirectoryParameter = parser
.add(new DirectoryParameter("Working directory."))
.addAliases("-w", "--working-directory").mustExist();
if (!parser.parse(args))
return null;
- if (recursiveParameter.isParameterSpecified())
+ if (recursiveParameter.isSpecified())
options.recursive = true;
- if (workingDirectoryParameter.isParameterSpecified())
+ if (workingDirectoryParameter.isSpecified())
options.targetDirectory = workingDirectoryParameter.getValue();
else
options.targetDirectory = new File(System.getProperty("user.dir"));
// TODO: add support for multiple input patterns
- if (inputPatternParameter.isParameterSpecified())
+ if (inputPatternParameter.isSpecified())
options.inputPatterns.addAll(inputPatternParameter.getValue());
return options;