From eba9bc5eaaf3d7f74befe68f37dac6c1dc467546 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 29 May 2005 11:58:47 +0000 Subject: r7076: added demos of using ARGV[] (This used to be commit 9679f2027209543108428e985bf699b370385eeb) --- testprogs/ejs/argv.js | 7 +++++++ testprogs/ejs/loadparm.js | 11 ++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 testprogs/ejs/argv.js (limited to 'testprogs') 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"); + -- cgit