r9491: fixed up a few scripts that need to be updated for the new GetOptions syntax...
authorAndrew Tridgell <tridge@samba.org>
Mon, 22 Aug 2005 23:31:18 +0000 (23:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:34:21 +0000 (13:34 -0500)
a good idea to use grep -r to find places that need fixing when you change the syntax of
a call :-)

source/scripting/bin/winreg
testprogs/ejs/argv.js
testprogs/ejs/echo.js
testprogs/ejs/ldap.js
testprogs/ejs/nbtstats
testprogs/ejs/samr.js

index d869d356fddadd9716400e316b51e3b010a48649..7656c8a4410d5f3f49f87cd4b9784c0c8b7d47db 100755 (executable)
@@ -9,14 +9,12 @@ exec smbscript "$0" ${1+"$@"}
 libinclude("base.js");
 libinclude("winreg.js");
 
-var options = new Object();
-
-ok = GetOptions(ARGV, options,
-               "POPT_AUTOHELP",
-               "POPT_COMMON_SAMBA",
-               "POPT_COMMON_CREDENTIALS");
-if (ok == false) {
-       println("Failed to parse options: " + options.ERROR);
+var options = GetOptions(ARGV,
+                        "POPT_AUTOHELP",
+                        "POPT_COMMON_SAMBA",
+                        "POPT_COMMON_CREDENTIALS");
+if (options == undefined) {
+       println("Failed to parse options");
        return -1;
 }
 
index 093123014a201a423f2ba0bdf3f368eea304c12a..ffb6e007eb6b88ba191522b14cdf9447e39b878e 100644 (file)
@@ -2,16 +2,12 @@
        demonstrate use of GetOptions
 */
 
-var ok;
-var options = new Object();
-
-ok = GetOptions(ARGV, options,
+var options = GetOptions(ARGV, 
                "POPT_AUTOHELP",
                "POPT_COMMON_SAMBA",
                "myopt=s",
                "intopt=i",
                "noopt");
-printVars(ok);
 
 println("You called this script with arguments:");
 
index 2875d1fb0e26bb376272edb938f49ceac16af19f..e694193c4be3e863befb63312794f5d700e44e20 100755 (executable)
@@ -3,14 +3,12 @@
        test echo pipe calls from ejs
 */     
 
-var options = new Object();
-
-ok = GetOptions(ARGV, options,
+var options = GetOptions(ARGV, 
                "POPT_AUTOHELP",
                "POPT_COMMON_SAMBA",
                "POPT_COMMON_CREDENTIALS");
-if (ok == false) {
-   println("Failed to parse options: " + options.ERROR);
+if (options == undefined) {
+   println("Failed to parse options");
    return -1;
 }
 
index 28a08879cf50e60187e7396ebe8271ad3442c0d7..e1099d5ff0cf3345ba5db1637ef4c82af7431a13 100755 (executable)
@@ -6,14 +6,12 @@ exec smbscript "$0" ${1+"$@"}
 
 var ldb = ldb_init();
 
-var options = new Object();
-
-ok = GetOptions(ARGV, options,
+var options = GetOptions(ARGV, 
                "POPT_AUTOHELP",
                "POPT_COMMON_SAMBA",
                "POPT_COMMON_CREDENTIALS");
-if (ok == false) {
-   println("Failed to parse options: " + options.ERROR);
+if (options == undefined) {
+   println("Failed to parse options");
    return -1;
 }
 
index 20bc781f03c387ce9d05c2831a38dfe651e76d12..1c8a6a5e7ec81528122cc002886b1d4a37224c17 100755 (executable)
@@ -3,13 +3,11 @@
        demonstrate access to irpc calls from ejs
 */     
 
-var options = new Object();
-
-ok = GetOptions(ARGV, options,
-               "POPT_AUTOHELP",
-               "POPT_COMMON_SAMBA");
-if (ok == false) {
-   println("Failed to parse options: " + options.ERROR);
+var options = GetOptions(ARGV, 
+                        "POPT_AUTOHELP",
+                        "POPT_COMMON_SAMBA");
+if (options == undefined) {
+   println("Failed to parse options");
    return -1;
 }
 
index b518fea234b84d37d69f647ce8ebc91670ae3ccf..fbdae974bea4500194e48ac69f73681027b7530e 100755 (executable)
@@ -3,14 +3,12 @@
   test samr calls from ejs
 */     
 
-var options = new Object();
-
-ok = GetOptions(ARGV, options,
-               "POPT_AUTOHELP",
-               "POPT_COMMON_SAMBA",
-               "POPT_COMMON_CREDENTIALS");
-if (ok == false) {
-   println("Failed to parse options: " + options.ERROR);
+var options = GetOptions(ARGV, 
+                        "POPT_AUTOHELP",
+                        "POPT_COMMON_SAMBA",
+                        "POPT_COMMON_CREDENTIALS");
+if (options == undefined) {
+   println("Failed to parse options");
    return -1;
 }