Skip to content

Commit

Permalink
Finish clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Sep 24, 2024
1 parent 228fff0 commit fc4e79d
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

Expand Down Expand Up @@ -87,9 +86,9 @@ public class GtfsTransformerMain {

private static final String ARG_OVERWRITE_DUPLICATES = "overwriteDuplicates";

private static CommandLineParser _parser = new PosixParser();
private static final CommandLineParser parser = new PosixParser();

private Options _options = new Options();
private final Options options = new Options();

public static void main(String[] args) throws IOException {
GtfsTransformerMain m = new GtfsTransformerMain();
Expand All @@ -98,7 +97,7 @@ public static void main(String[] args) throws IOException {

public GtfsTransformerMain() {

buildOptions(_options);
buildOptions(options);
}

/*****************************************************************************
Expand All @@ -113,13 +112,9 @@ public void run(String[] args) throws IOException {
}

try {
CommandLine cli = _parser.parse(_options, args, true);
CommandLine cli = parser.parse(options, args, true);
runApplication(cli, args);
} catch (MissingOptionException ex) {
System.err.println("Missing argument: " + ex.getMessage());
printHelp();
System.exit(-2);
} catch (MissingArgumentException ex) {
} catch (MissingOptionException | MissingArgumentException ex) {
System.err.println("Missing argument: " + ex.getMessage());
printHelp();
System.exit(-2);
Expand Down Expand Up @@ -193,7 +188,7 @@ private void printHelp() throws IOException {
protected void runApplication(CommandLine cli, String[] originalArgs)
throws Exception {

var args = Arrays.stream(cli.getArgs()).toList();
var args = cli.getArgList();

if (args.size() < 2) {
printHelp();
Expand Down Expand Up @@ -382,9 +377,9 @@ private boolean needsHelp(String[] args) {

private static class Ordered<T> implements Comparable<Ordered<T>> {

private T _object;
private final T _object;

private int _order;
private final int _order;

public Ordered(T object, int order) {
_object = object;
Expand Down

0 comments on commit fc4e79d

Please sign in to comment.