r7076: added demos of using ARGV[]
authorAndrew Tridgell <tridge@samba.org>
Sun, 29 May 2005 11:58:47 +0000 (11:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:17:12 +0000 (13:17 -0500)
testprogs/ejs/argv.js [new file with mode: 0644]
testprogs/ejs/loadparm.js

diff --git a/testprogs/ejs/argv.js b/testprogs/ejs/argv.js
new file mode 100644 (file)
index 0000000..2f8dc74
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+       demonstrate use of argv
+*/
+
+println("You called this script with arguments:");
+
+printVars(ARGV);
index fdeaed9d348b2b55b693aedff84e4e328071be9a..6c2a80bb73ac996f6e8cada8a009b5b83f5400c7 100644 (file)
@@ -2,14 +2,18 @@
        demonstrate access to loadparm functions from ejs
 */     
 
        demonstrate access to loadparm functions from ejs
 */     
 
-print("defined services: ");
-printVars(lpServices());
-
 function showParameter(name) {
         print(name + ": ");
         printVars(lpGet(name));
 }
 
 function showParameter(name) {
         print(name + ": ");
         printVars(lpGet(name));
 }
 
+for (v in ARGV) {
+    showParameter(ARGV[v]);
+}
+
+print("defined services: ");
+printVars(lpServices());
+
 showParameter("server services");
 showParameter("netbios name");
 showParameter("security");
 showParameter("server services");
 showParameter("netbios name");
 showParameter("security");
@@ -17,3 +21,4 @@ showParameter("workgroup");
 showParameter("log level");
 showParameter("server signing");
 showParameter("interfaces");
 showParameter("log level");
 showParameter("server signing");
 showParameter("interfaces");
+