Command-line arguments: Difference between revisions

→‎{{header|AWK}}: move to "Parse command-line arguments intelligently"
(→‎{{header|AWK}}: move to "Parse command-line arguments intelligently")
Line 113:
print "Argument " l " is " ARGV[l]
}
}</lang>
 
{{works with|gawk}}
<lang awk>#!/usr/bin/awk -E
# -E instead of -f so program arguments don't conflict with Gawk arguments
@include "getopt.awk"
BEGIN {
while ((C = getopt(ARGC, ARGV, "th:")) != -1) {
opti++
}
print "There are " opti " arguments."
}</lang>