diff options
author | Russ Cox <rsc@golang.org> | 2013-01-06 15:24:47 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2013-01-06 15:24:47 -0500 |
commit | 6c0f0051a2389148de9eccf7330e3091bfcbe774 (patch) | |
tree | e16240ce54f316174bd0bf8d2ded67842b478cc2 /include | |
parent | 5b3a4e497e1edd00ec0b995be05be4f31c1495da (diff) | |
download | go-6c0f0051a2389148de9eccf7330e3091bfcbe774.tar.gz |
cmd/5l, cmd/6l, cmd/8l, cmd/cc, cmd/gc: new flag parsing
This CL adds a flag parser that matches the semantics of Go's
package flag. It also changes the linkers and compilers to use
the new flag parser.
Command lines that used to work, like
8c -FVw
6c -Dfoo
5g -I/foo/bar
now need to be split into separate arguments:
8c -F -V -w
6c -D foo
5g -I /foo/bar
The new spacing will work with both old and new tools.
The new parser also allows = for arguments, as in
6c -D=foo
5g -I=/foo/bar
but that syntax will not work with the old tools.
In addition to matching standard Go binary flag parsing,
the new flag parser generates more detailed usage messages
and opens the door to long flag names.
The recently added gc flag -= has been renamed -complete.
R=remyoudompheng, daniel.morsing, minux.ma, iant
CC=golang-dev
https://codereview.appspot.com/7035043
Diffstat (limited to 'include')
-rw-r--r-- | include/libc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/libc.h b/include/libc.h index 42c653cf5..9486b1143 100644 --- a/include/libc.h +++ b/include/libc.h @@ -292,6 +292,16 @@ extern char* getgoversion(void); extern char* getgoarm(void); extern char* getgo386(void); +extern void flagcount(char*, char*, int*); +extern void flagint32(char*, char*, int32*); +extern void flagint64(char*, char*, int64*); +extern void flagstr(char*, char*, char**); +extern void flagparse(int*, char***, void (*usage)(void)); +extern void flagfn0(char*, char*, void(*fn)(void)); +extern void flagfn1(char*, char*, void(*fn)(char*)); +extern void flagfn2(char*, char*, void(*fn)(char*, char*)); +extern void flagprint(int); + #ifdef _WIN32 #ifndef _WIN64 |