diff --git a/java/src/org/broadinstitute/sting/utils/cmdLine/ArgumentTypeDescriptor.java b/java/src/org/broadinstitute/sting/utils/cmdLine/ArgumentTypeDescriptor.java index 9c7db1d01..d2ee0e057 100644 --- a/java/src/org/broadinstitute/sting/utils/cmdLine/ArgumentTypeDescriptor.java +++ b/java/src/org/broadinstitute/sting/utils/cmdLine/ArgumentTypeDescriptor.java @@ -278,7 +278,12 @@ class SimpleArgumentTypeDescriptor extends ArgumentTypeDescriptor { catch (NoSuchFieldException e) { throw new StingException("parsing " + type.toString() + "doesn't contain the field " + val.toString()); } } // if their argument has no value (null), and there's a default, return that default for the enum value - if (defaultEnumeration != null && value == null) return defaultEnumeration; + if (defaultEnumeration != null && value == null) + return defaultEnumeration; + // if their argument has no value and there's no default, throw a missing argument value exception. + // TODO: Clean this up so that null values never make it to this point. To fix this, we'll have to clean up the implementation of -U. + if (value == null) + throw new MissingArgumentValueException(Collections.singleton(createDefaultArgumentDefinition(source))); throw new UnknownEnumeratedValueException(value, type.getName()); } else { Constructor ctor = type.getConstructor(String.class); diff --git a/java/src/org/broadinstitute/sting/utils/cmdLine/CommandLineProgram.java b/java/src/org/broadinstitute/sting/utils/cmdLine/CommandLineProgram.java index 20ff5b309..eb56e63aa 100644 --- a/java/src/org/broadinstitute/sting/utils/cmdLine/CommandLineProgram.java +++ b/java/src/org/broadinstitute/sting/utils/cmdLine/CommandLineProgram.java @@ -27,7 +27,7 @@ import java.util.Enumeration; *

*

* This class is our implementation of the command line parser, similar to Pickard's. We instead - * support GNU style command line arguements, and use this class to setup the global parser. + * support GNU style command line arguments, and use this class to setup the global parser. */ public abstract class CommandLineProgram {