+ show_uniq_lhs = 0
+ shoq_uniq_rhs = 0
+ show_common = 1
+
+ # Process command-line options
+ for (i = 1; i < ARGC; i++) {
+ if (substr(ARGV[i], 1, 1) != "-" || ARGV[i] == "-")
+ break;
+
+ opt = substr(ARGV[i], 2, 1);
+ if (opt == "a" || opt == "v") {
+ num = substr(ARGV[i], 3, 1);
+ if (num == "") {
+ # option argument must be next on command-line
+ ARGV[i++] = "";
+ num = ARGV[i];
+ }
+
+ if (opt == "v") {
+ show_common = 0;
+ }
+
+ if (num == 1) {
+ show_uniq_lhs = 1;
+ } else if (num == 2) {
+ show_uniq_rhs = 1;
+ } else {
+ # invalid argument
+ exit 1;
+ }
+ } else {
+ # unsupported option
+ exit 1;
+ }
+
+ ARGV[i] = "";
+ }
+
+ if (i+2 != ARGC) {
+ # invalid usage