summaryrefslogtreecommitdiff
path: root/testprogs/ejs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-29 11:58:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:17:12 -0500
commiteba9bc5eaaf3d7f74befe68f37dac6c1dc467546 (patch)
tree0ff1b9e596e5126827fcd8550153449e7c649489 /testprogs/ejs
parentf477a741293673adad784c55a749031a290bd072 (diff)
downloadsamba-eba9bc5eaaf3d7f74befe68f37dac6c1dc467546.tar.gz
samba-eba9bc5eaaf3d7f74befe68f37dac6c1dc467546.tar.bz2
samba-eba9bc5eaaf3d7f74befe68f37dac6c1dc467546.zip
r7076: added demos of using ARGV[]
(This used to be commit 9679f2027209543108428e985bf699b370385eeb)
Diffstat (limited to 'testprogs/ejs')
-rw-r--r--testprogs/ejs/argv.js7
-rw-r--r--testprogs/ejs/loadparm.js11
2 files changed, 15 insertions, 3 deletions
diff --git a/testprogs/ejs/argv.js b/testprogs/ejs/argv.js
new file mode 100644
index 0000000000..2f8dc74174
--- /dev/null
+++ b/testprogs/ejs/argv.js
@@ -0,0 +1,7 @@
+/*
+ demonstrate use of argv
+*/
+
+println("You called this script with arguments:");
+
+printVars(ARGV);
diff --git a/testprogs/ejs/loadparm.js b/testprogs/ejs/loadparm.js
index fdeaed9d34..6c2a80bb73 100644
--- a/testprogs/ejs/loadparm.js
+++ b/testprogs/ejs/loadparm.js
@@ -2,14 +2,18 @@
demonstrate access to loadparm functions from ejs
*/
-print("defined services: ");
-printVars(lpServices());
-
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");
@@ -17,3 +21,4 @@ showParameter("workgroup");
showParameter("log level");
showParameter("server signing");
showParameter("interfaces");
+