You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think your solution is as good as any. I only extended it to allow for negative floating point values:
for (String arg : args) {
if (arg.startsWith("-") && !arg.matches("^-[0-9]+(\\.[0-9]*)?$")) {
switchName = arg;
argsTable.put(switchName, "");
}
else {
if (switchName != null) {
argsTable.put(switchName, arg);
switchName = null;
}
}
}
It seems to work:
I put the new installer on the RSNA MIRC site and pushed the change to GitHub.
Thanks for finding this problem.
JP
From: Joe Mesterhazy
Sent: Friday, January 12, 2018 2:43 PM
To: johnperry/DicomAnonymizerTool
Cc: Subscribed
Subject: [johnperry/DicomAnonymizerTool] Passing parameter value that contains a hyphen (eg. negative number) (#1)
If you pass a parameter value on the command line, that is a negative number, the argument parser thinks it's an argument and it doesn't work. eg:
-pDATEINC "-10"
I made a quick fix using this patch:
--- a/source/java/org/rsna/dicomanonymizertool/DicomAnonymizerTool.java
+++ b/source/java/org/rsna/dicomanonymizertool/DicomAnonymizerTool.java
@@ -89,7 +89,7 @@ public class DicomAnonymizerTool {
Hashtable<String,String> argsTable = new Hashtable<String,String>();
String switchName = null;
for (String arg : args) {
- if (arg.startsWith("-")) {
+ if (arg.startsWith("-") && !arg.matches("^-[0-9]+$")) {
switchName = arg;
argsTable.put(switchName, "");
}
But you might want to implement something more elegant.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
If you pass a parameter value on the command line, that is a negative number, the argument parser thinks it's an argument and it doesn't work. eg:
-pDATEINC "-10"
I made a quick fix using this patch:
But you might want to implement something more elegant.
The text was updated successfully, but these errors were encountered: