Command-line arguments: Difference between revisions

Content added Content deleted
(Add min)
(Add Genie)
Line 784: Line 784:
NEXT
NEXT
END</lang>
END</lang>

=={{header|Genie}}==
<lang genie>[indent=4]
/*
Command line arguments, in Genie

valac commandLine.gs
./commandLine sample arguments 'four in total here, including args 0'
*/

init

// Output the number of arguments
print "%d command line argument(s):", args.length

// Enumerate all command line arguments
for s in args
print s

// to reiterate, args[0] is the command
if args[0] is not null
print "\nWith Genie, args[0] is the command: %s", args[0]</lang>

{{out}}
<pre>prompt$ valac commandLine.gs
prompt$ ./commandLine -c "alpha beta" -h "gamma"
5 command line argument(s):
./commandLine
-c
alpha beta
-h
gamma

With Genie, args[0] is the command: ./commandLine</pre>


=={{header|Global Script}}==
=={{header|Global Script}}==