Description: Add Usage
 This proves useful when generating man page (help2man)
Forwarded: not-needed
Author: Mathieu Malaterre <malat@debian.org>

--- a/com/pixelmed/network/VerificationSOPClassSCU.java
+++ b/com/pixelmed/network/VerificationSOPClassSCU.java
@@ -196,6 +196,11 @@ public class VerificationSOPClassSCU ext
 	 * @param	arg	array of four to seven strings - their hostname, their port, their AE Title, our AE Title, and optionally a string flag valued SECURE or NONSECURE, an optional username and an optional password
 	 */
 	public static void main(String arg[]) {
+    if (arg.length <= 4) {
+      System.err.println("Error: Incorrect number of arguments");
+      System.err.println("Usage: VerificationSOPClassSCU hostname port ae_title called_ae_title [SECURE|NONSECURE] [username] [password]");
+      System.exit(1);
+    }
 		boolean secure = arg.length >= 5 && arg[4].toUpperCase(java.util.Locale.US).equals("SECURE");
 		String username = arg.length >= 6 ? arg[5] : null;
 		String password = arg.length >= 7 ? arg[6] : null;
--- a/com/pixelmed/validate/DicomSRValidator.java
+++ b/com/pixelmed/validate/DicomSRValidator.java
@@ -439,6 +439,11 @@ public class DicomSRValidator {
 	 * @param	arg	optionally -describe, -donotcheckcodemeaning, -donotmatchcase, -donotcheckdeprecatedcodingscheme, -checkambiguoustemplate, -checkcontentitemorder, -checktemplateid, then the name of the file containing the DICOM SR instance to be validated
 	 */
 	public static void main(String arg[]) {
+    if (arg.length < 1 || arg[0].equals("--help")) {
+      System.err.println("Error: Incorrect number of arguments");
+      System.err.println("Usage: DicomSRValidator dicom_sr_filename");
+      System.exit(1);
+    }
 		try {
 			DicomSRValidator validator = new DicomSRValidator();
 			boolean describe = false;
--- a/com/pixelmed/dicom/PDFToDicomImage.java
+++ b/com/pixelmed/dicom/PDFToDicomImage.java
@@ -194,6 +194,11 @@ public class PDFToDicomImage {
 	 */
 	public static void main(String arg[]) {
 		try {
+    if (arg.length <= 4) {
+      System.err.println("Error: Incorrect number of arguments");
+      System.err.println("Usage: PDFToDicomImage inputFile outputFile patientName patientID studyID seriesNumber instanceNumber requestedDpi");
+      System.exit(1);
+    }
 			new PDFToDicomImage(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],Integer.parseInt(arg[7]));
 		}
 		catch (Exception e) {
--- a/com/pixelmed/dicom/StructuredReport.java
+++ b/com/pixelmed/dicom/StructuredReport.java
@@ -386,6 +386,12 @@ public class StructuredReport implements
 	 */
 	public static void main(String arg[]) {
 		try {
+    if (arg.length < 1 || arg[0].equals("--help")) {
+      System.err.println("Error: Incorrect number of arguments");
+      System.err.println("Usage: Structured dicom_sr_filename");
+      System.exit(1);
+    }
+
 			AttributeList list = new AttributeList();
 			list.read(arg[0]);
 			StructuredReport sr = new StructuredReport(list);
