couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rand...@apache.org
Subject [2/3] git commit: fix couchjs help language and use short options
Date Sun, 02 Oct 2011 21:13:07 GMT
fix couchjs help language and use short options


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/89a70b17
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/89a70b17
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/89a70b17

Branch: refs/heads/1.2.x
Commit: 89a70b175294799a5f33e26dc0c517e6c30cb815
Parents: 2585c47
Author: Randall Leeds <randall@apache.org>
Authored: Sun Oct 2 14:04:27 2011 -0700
Committer: Randall Leeds <randall@apache.org>
Committed: Sun Oct 2 14:08:29 2011 -0700

----------------------------------------------------------------------
 src/couchdb/priv/couch_js/help.h |   12 ++++++------
 src/couchdb/priv/couch_js/util.c |   21 +++++----------------
 test/javascript/run.tpl          |    2 +-
 3 files changed, 12 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/89a70b17/src/couchdb/priv/couch_js/help.h
----------------------------------------------------------------------
diff --git a/src/couchdb/priv/couch_js/help.h b/src/couchdb/priv/couch_js/help.h
index e7c3af0..84c83c0 100644
--- a/src/couchdb/priv/couch_js/help.h
+++ b/src/couchdb/priv/couch_js/help.h
@@ -46,12 +46,12 @@ static const char USAGE_TEMPLATE[] =
     "\n"
     "Options:\n"
     "\n"
-    "  -h, --help          display a short help message and exit\n"
-    "  -V, --version       display version information and exit\n"
-    "  -H, --http          install %s cURL bindings (only avaiable\n"
-    "                      if package was built with cURL available)\n"
-    "  --stack-size=SIZE   specify that the interpreter should set the\n"
-    "                      the stack quota for JS contexts to SIZE bytes\n"
+    "  -h          display a short help message and exit\n"
+    "  -V          display version information and exit\n"
+    "  -H          enable %s cURL bindings (only avaiable\n"
+    "              if package was built with cURL available)\n"
+    "  -S SIZE     specify that the interpreter should set the\n"
+    "              the stack quota for JS contexts to SIZE bytes\n"
     "\n"
     "Report bugs at <%s>.\n";
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/89a70b17/src/couchdb/priv/couch_js/util.c
----------------------------------------------------------------------
diff --git a/src/couchdb/priv/couch_js/util.c b/src/couchdb/priv/couch_js/util.c
index ab1295f..3076856 100644
--- a/src/couchdb/priv/couch_js/util.c
+++ b/src/couchdb/priv/couch_js/util.c
@@ -80,27 +80,16 @@ couch_parse_args(int argc, const char* argv[])
     args->stack_size = 8L * 1024L;
 
     while(i < argc) {
-        if(strcmp("-h", argv[i]) == 0 ||
-           strcmp("--help", argv[i]) == 0) {
+        if(strcmp("-h", argv[i]) == 0) {
             DISPLAY_USAGE;
             exit(0);
-        } else if(strcmp("-V", argv[i]) == 0 ||
-                  strcmp("--version", argv[i]) == 0) {
+        } else if(strcmp("-V", argv[i]) == 0) {
             DISPLAY_VERSION;
             exit(0);
-        } else if(strcmp("-H", argv[i]) == 0 ||
-                  strcmp("--http", argv[i]) == 0) {
+        } else if(strcmp("-H", argv[i]) == 0) {
             args->use_http = 1;
-        } else if(strncmp("--stack-size", argv[i], 12) == 0) {
-            if(argv[i][12] == '\0') {
-                args->stack_size = atoi(argv[++i]);
-            } else if(argv[i][12] == '=') {
-                args->stack_size = atoi(argv[i]+13);
-            } else {
-                DISPLAY_USAGE;
-                exit(2);
-            }
-
+        } else if(strcmp("-S", argv[i]) == 0) {
+            args->stack_size = atoi(argv[++i]);
             if(args->stack_size <= 0) {
                 fprintf(stderr, "Invalid stack size.\n");
                 exit(2);

http://git-wip-us.apache.org/repos/asf/couchdb/blob/89a70b17/test/javascript/run.tpl
----------------------------------------------------------------------
diff --git a/test/javascript/run.tpl b/test/javascript/run.tpl
index 07c3c74..e4a2029 100644
--- a/test/javascript/run.tpl
+++ b/test/javascript/run.tpl
@@ -44,4 +44,4 @@ cat $SCRIPT_DIR/json2.js \
 	$TEST_SRC \
 	$JS_TEST_DIR/couch_http.js \
 	$JS_TEST_DIR/cli_runner.js \
-    | $COUCHJS --http -
+    | $COUCHJS -H -


Mime
View raw message