From 673be59d12558523ff9ff8e5a4971d9e9e84b15f Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Tue, 20 Dec 2011 14:46:09 -0700
Subject: [PATCH] (loadgen) allow -l to be specified without -s.  closes #782

---
 bin/load_gen | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/bin/load_gen b/bin/load_gen
index 513353340..5eb1ea00b 100755
--- a/bin/load_gen
+++ b/bin/load_gen
@@ -58,8 +58,11 @@ var argv = require('optimist')
 .describe('o', 'when enabled, only dynamic WSAPI calls will be simulated, not static resource requests')
 .default('o', false)
 .alias('s', 'server')
+.string('s')
 .describe('s', 'base URL to browserid server')
-.demand('s')
+.check(function(argv) {
+  return (typeof argv.s === 'string' || argv.l) != undefined;
+})
 .alias('v', 'verifier')
 .describe('v', 'base URL to verifier service (default is browserid server + \'/verify\')')
 .alias('u', 'user-range')
@@ -67,11 +70,6 @@ var argv = require('optimist')
 
 var args = argv.argv;
 
-if (args.h) {
-  argv.showHelp();
-  process.exit(1);
-}
-
 // global configuration
 const configuration = {
   verifier: args.v ? args.v : args.s + "/verify",
@@ -139,6 +137,11 @@ if (args.l) {
   process.exit(0);
 }
 
+if (args.h) {
+  argv.showHelp();
+  process.exit(1);
+}
+
 var activitiesToRun = Object.keys(activity);
 
 // handle modification of activities to run (-o or -a)
-- 
GitLab