commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r950500 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/Lister.java
Date Wed, 02 Jun 2010 11:33:13 GMT
Author: sebb
Date: Wed Jun  2 11:33:13 2010
New Revision: 950500

URL: http://svn.apache.org/viewvc?rev=950500&view=rev
Log:
Handle missing argument better

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/Lister.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/Lister.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/Lister.java?rev=950500&r1=950499&r2=950500&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/Lister.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/Lister.java
Wed Jun  2 11:33:13 2010
@@ -39,6 +39,10 @@ public final class Lister {
     private static final ArchiveStreamFactory factory = new ArchiveStreamFactory();
     
     public static void main(String[] args) throws Exception {
+        if (args.length == 0) {
+            usage();
+            return;
+        }
         System.out.println("Analysing "+args[0]);
         File f = new File(args[0]);
         if (!f.isFile()) {
@@ -60,4 +64,9 @@ public final class Lister {
         fis.close();
     }
 
+    private static void usage() {
+        System.out.println("Parameters: archive-name [archive-type]");
+        
+    }
+
 }
\ No newline at end of file



Mime
View raw message