summaryrefslogtreecommitdiff
path: root/src/lib/flag.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/flag.go')
-rw-r--r--src/lib/flag.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/flag.go b/src/lib/flag.go
index f8e31ca68..d8830c9dc 100644
--- a/src/lib/flag.go
+++ b/src/lib/flag.go
@@ -290,6 +290,11 @@ func NArg() int {
return len(sys.Args) - flags.first_arg
}
+// Args returns the non-flag command-line arguments.
+func Args() []string {
+ return sys.Args[flags.first_arg:len(sys.Args)];
+}
+
func add(name string, value FlagValue, usage string) {
// Remember the default value as a string; it won't change.
f := &Flag{name, usage, value, value.String()};