Permalink
Browse files

Argument check

  • Loading branch information...
pksunkara committed Sep 14, 2011
1 parent 7ebebfa commit 84e4207911c8544c65e945694343e6f3e8bf643a
Showing with 16 additions and 0 deletions.
  1. +4 −0 VectorClock/Agent.java
  2. +12 −0 VectorClock/Ranger.java
View
@@ -7,6 +7,10 @@
private static FileWriter fileStream;
public static void main(String[] args) {
+ if(args.length!=1) {
+ System.out.println("Usage: Agent <codename>");
+ System.exit(1);
+ }
nodeName = args[0];
report("Initialised mission SuperSecret!");
View
@@ -1,4 +1,16 @@
+import java.io.*;
+
public class Ranger {
+
+ private static String nodeName = "";
+
+ private static FileWriter fileStream;
+
public static void main(String[] args) {
+ if(args.length!=1) {
+ System.out.println("Usage: Ranger <codename>");
+ System.exit(1);
+ }
+ nodeName = args[0];
}
}

0 comments on commit 84e4207

Please sign in to comment.