From 1864b27857c71b998dd201acaaa3c8664b8be960 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 Jul 2005 07:43:36 +0000 Subject: r8317: convert the example scripts over to the new GetOptions() call (This used to be commit 5f079d74630cf6431ec8af7240f60054cf8b9ab7) --- testprogs/ejs/echo.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'testprogs/ejs/echo.js') diff --git a/testprogs/ejs/echo.js b/testprogs/ejs/echo.js index 312e599d50..e5b0b2b1bf 100755 --- a/testprogs/ejs/echo.js +++ b/testprogs/ejs/echo.js @@ -3,6 +3,17 @@ test echo pipe 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); + return -1; +} + libinclude("base.js"); /* @@ -198,7 +209,11 @@ if (ARGV.length == 0) { exit(0); } -var binding = ARGV[0]; +if (options.ARGV.length != 1) { + println("Usage: samr.js "); + return -1; +} +var binding = options.ARGV[0]; var conn = new Object(); print("Connecting to " + binding + "\n"); -- cgit