Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4892)

Issue 7035043: code review 7035043: cmd/5l, cmd/6l, cmd/8l, cmd/cc, cmd/gc: new flag parsing (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 3 months ago by rsc
Modified:
11 years, 3 months ago
Reviewers:
CC:
remyoudompheng, DMorsing, minux1, iant, golang-dev
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : diff -r 84f88ed1dd63 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 84f88ed1dd63 https://code.google.com/p/go/ #

Total comments: 30

Patch Set 4 : diff -r 84f88ed1dd63 https://code.google.com/p/go/ #

Patch Set 5 : diff -r 26261a8f9035 https://code.google.com/p/go/ #

Patch Set 6 : diff -r 26261a8f9035 https://code.google.com/p/go/ #

Total comments: 6

Patch Set 7 : diff -r b2bc77ca3160 https://code.google.com/p/go/ #

Total comments: 10

Patch Set 8 : diff -r f483bfe81114 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+604 lines, -326 lines) Patch
M doc/go1.1.html View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
M include/libc.h View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
M src/cmd/5c/peep.c View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/5l/l.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/5l/obj.c View 1 2 3 4 5 6 7 2 chunks +36 lines, -64 lines 0 comments Download
M src/cmd/6l/l.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M src/cmd/6l/obj.c View 1 2 3 4 5 6 7 2 chunks +35 lines, -64 lines 0 comments Download
M src/cmd/8l/l.h View 1 2 3 4 5 6 7 2 chunks +1 line, -2 lines 0 comments Download
M src/cmd/8l/obj.c View 1 2 3 4 5 6 7 2 chunks +34 lines, -62 lines 0 comments Download
M src/cmd/cc/cc.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/cc/lex.c View 1 2 3 4 5 6 2 chunks +76 lines, -39 lines 0 comments Download
M src/cmd/cc/sub.c View 1 2 3 4 5 6 1 chunk +0 lines, -6 lines 0 comments Download
M src/cmd/gc/go.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/cmd/gc/lex.c View 1 2 3 4 5 6 7 4 chunks +52 lines, -74 lines 0 comments Download
M src/cmd/go/build.go View 1 2 3 4 6 chunks +8 lines, -8 lines 0 comments Download
M src/cmd/ld/lib.h View 1 2 3 4 5 6 7 3 chunks +5 lines, -0 lines 0 comments Download
M src/cmd/ld/lib.c View 1 2 3 4 5 6 7 1 chunk +28 lines, -0 lines 0 comments Download
A src/lib9/flag.c View 1 2 3 4 5 6 7 1 chunk +300 lines, -0 lines 0 comments Download

Messages

Total messages: 15
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 3 months ago (2012-12-30 02:47:34 UTC) #1
remyoudompheng
https://codereview.appspot.com/7035043/diff/1002/src/cmd/5l/obj.c File src/cmd/5l/obj.c (right): https://codereview.appspot.com/7035043/diff/1002/src/cmd/5l/obj.c#newcode104 src/cmd/5l/obj.c:104: flagfn1("I", "interp: set ELF interp", setinterp); There are P ...
11 years, 3 months ago (2012-12-30 08:37:16 UTC) #2
DMorsing
This CL gives a bunch of errors on gcc 4.7.2, mostly because of giving int ...
11 years, 3 months ago (2012-12-30 09:34:18 UTC) #3
rsc
On Sun, Dec 30, 2012 at 4:34 AM, <daniel.morsing@gmail.com> wrote: > This CL gives a ...
11 years, 3 months ago (2012-12-30 15:24:49 UTC) #4
rsc
PTAL Thank you for the very detailed review. https://codereview.appspot.com/7035043/diff/1002/src/cmd/5l/obj.c File src/cmd/5l/obj.c (right): https://codereview.appspot.com/7035043/diff/1002/src/cmd/5l/obj.c#newcode104 src/cmd/5l/obj.c:104: flagfn1("I", ...
11 years, 3 months ago (2012-12-30 15:40:37 UTC) #5
minux1
On 2012/12/30 15:24:49, rsc wrote: > in which directory? i probably forgot to put a ...
11 years, 3 months ago (2012-12-30 15:41:55 UTC) #6
rsc
where is vlong != int64?
11 years, 3 months ago (2012-12-30 15:45:51 UTC) #7
rsc
I cleaned out the other CLs from my client and uploaded a new one here. ...
11 years, 3 months ago (2012-12-30 15:48:31 UTC) #8
minux1
On Sun, Dec 30, 2012 at 11:45 PM, Russ Cox <rsc@golang.org> wrote: > where is ...
11 years, 3 months ago (2012-12-30 15:56:15 UTC) #9
DMorsing
All errors/warnings are fixed now. This CL exposes the various debug only flags via the ...
11 years, 3 months ago (2012-12-30 16:21:39 UTC) #10
minux1
found three used but not declared flags in cc. https://codereview.appspot.com/7035043/diff/6019/src/cmd/cc/lex.c File src/cmd/cc/lex.c (right): https://codereview.appspot.com/7035043/diff/6019/src/cmd/cc/lex.c#newcode157 src/cmd/cc/lex.c:157: ...
11 years, 3 months ago (2012-12-30 18:08:35 UTC) #11
rsc
PTAL https://codereview.appspot.com/7035043/diff/6019/src/cmd/cc/lex.c File src/cmd/cc/lex.c (right): https://codereview.appspot.com/7035043/diff/6019/src/cmd/cc/lex.c#newcode157 src/cmd/cc/lex.c:157: flagcount("Y", "debug index generation", &debug['Y']); On 2012/12/30 18:08:36, ...
11 years, 3 months ago (2013-01-02 20:51:21 UTC) #12
iant
LGTM https://codereview.appspot.com/7035043/diff/11005/doc/go1.1.html File doc/go1.1.html (right): https://codereview.appspot.com/7035043/diff/11005/doc/go1.1.html#newcode24 doc/go1.1.html:24: In the gc toolchain, the assemblers, compilers, and ...
11 years, 3 months ago (2013-01-04 17:17:55 UTC) #13
rsc
https://codereview.appspot.com/7035043/diff/11005/doc/go1.1.html File doc/go1.1.html (right): https://codereview.appspot.com/7035043/diff/11005/doc/go1.1.html#newcode24 doc/go1.1.html:24: In the gc toolchain, the assemblers, compilers, and linkers ...
11 years, 3 months ago (2013-01-06 20:09:16 UTC) #14
rsc
11 years, 3 months ago (2013-01-06 20:26:27 UTC) #15
*** Submitted as https://code.google.com/p/go/source/detail?r=12562bcfba22 ***

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
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b