aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-01-06 15:24:47 -0500
committerRuss Cox <rsc@golang.org>2013-01-06 15:24:47 -0500
commitcbbc6a102d5e7e5e2bb685a0c661d1f731c88344 (patch)
treeeb7e78f00642343fc7022d19ea4cb95b7d5d6269 /include
parentd37c572ad54921319653a4abdd749221f7779bb5 (diff)
downloadgo-cbbc6a102d5e7e5e2bb685a0c661d1f731c88344.tar.xz
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://golang.org/cl/7035043
Diffstat (limited to 'include')
-rw-r--r--include/libc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/libc.h b/include/libc.h
index 42c653cf5e..9486b11430 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