diff --git a/src/main/java/gov/nasa/pds/registry/mgr/cmd/dd/ListDDCmd.java b/src/main/java/gov/nasa/pds/registry/mgr/cmd/dd/ListDDCmd.java index 7d8af52..a15a699 100644 --- a/src/main/java/gov/nasa/pds/registry/mgr/cmd/dd/ListDDCmd.java +++ b/src/main/java/gov/nasa/pds/registry/mgr/cmd/dd/ListDDCmd.java @@ -34,11 +34,16 @@ public void run(CommandLine cmdLine) throws Exception return; } - String url = cmdLine.getOptionValue("es", "app:/connections/direct/localhost.xml"); String authFile = cmdLine.getOptionValue("auth"); - String namespace = cmdLine.getOptionValue("ns"); - + String url = cmdLine.getOptionValue("es", "app:/connections/direct/localhost.xml"); + + if (authFile == null || authFile.isBlank()) { + throw new IllegalArgumentException("missing argument: -auth must be given"); + } + if (namespace == null || namespace.isBlank()) { + throw new IllegalArgumentException("missing argument: -ns must be given"); + } try { RegistryManager.init(url, authFile);