#!/usr/bin/php -q = 2 && ($argv[1]=='--help' || $argv[1]=='-help')) { usage(); } if ($argc != 4) { // prompt for all values fwrite(STDOUT, "Enter username: "); $usr = trim(fgets(STDIN)); echo "\tusing \"$usr\"\n"; fwrite(STDOUT, "Enter password: "); $pwd = trim(fgets(STDIN)); echo "\tusing \"$pwd\"\n"; fwrite(STDOUT, "Enter email-address: "); $email = trim(fgets(STDIN)); echo "\tusing \"$email\"\n"; } else { // use values from cmdline $usr = (string)($argv[1]); $pwd = (string)($argv[2]); $email = (string)($argv[3]); } add_user($usr, $pwd, $email); ?>