From 6fa4f475026cca54f3acfad56e311a0fecb6110e Mon Sep 17 00:00:00 2001 From: Geoff Johnstone Date: Fri, 31 Dec 2010 23:04:49 +0000 Subject: [PATCH] Make ascent speed a command line option. --- src/net/ametros/dive/Main.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/net/ametros/dive/Main.java b/src/net/ametros/dive/Main.java index bea56e7..8bc7d4b 100644 --- a/src/net/ametros/dive/Main.java +++ b/src/net/ametros/dive/Main.java @@ -35,9 +35,6 @@ import java.util.ArrayList; public class Main { - private static final double V_a = 8; - - private static List L (String... strs) { final List l = new ArrayList (strs.length); @@ -89,6 +86,10 @@ public class Main final OptionSpec output = op.acceptsAll (L("o", "output"), "Output filename"). withRequiredArg().ofType (File.class); + final OptionSpec ascent = + op.acceptsAll (L("a", "ascent"), "Ascent speed, m/s"). + withRequiredArg().ofType (Double.class). + defaultsTo (8.0); final WriterFactory wf = new WriterFactory(); OptionSet options = null; @@ -119,6 +120,7 @@ public class Main System.exit (2); } + final double V_a = options.valueOf (ascent); final ParserFactory pf = new ParserFactory(); final DiveComputer dc = new DiveComputer(); boolean gotPlans = false; -- 2.11.4.GIT