summaryrefslogtreecommitdiff
path: root/src/pkg/flag
AgeCommit message (Collapse)AuthorFilesLines
2015-01-15Imported Upstream version 1.4upstream/1.4Tianon Gravi4-1318/+0
2014-06-19Imported Upstream version 1.3upstream/1.3Michael Stapelberg1-3/+3
2013-12-03Imported Upstream version 1.2upstream/1.2Michael Stapelberg3-47/+123
2013-03-04Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304Michael Stapelberg2-14/+67
2012-06-14Imported Upstream version 1.0.2upstream/1.0.2Ondřej Surý1-2/+3
2012-05-02Imported Upstream version 1.0.1upstream/1.0.1Ondřej Surý1-4/+6
2012-04-06Imported Upstream version 1upstream/1Ondřej Surý4-81/+274
2011-09-13Imported Upstream version 60upstream/60Ondřej Surý4-0/+993
2011-09-13Imported Upstream version 60Ondřej Surý4-936/+0
2011-08-03Imported Upstream version 59upstream/59Ondřej Surý1-1/+1
2011-06-30Imported Upstream version 58upstream/58Ondřej Surý3-143/+338
2011-04-28Imported Upstream version 2011.04.27upstream/2011.04.27Ondřej Surý1-1/+1
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý2-16/+40
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý2-7/+7
2011-02-14Imported Upstream version 2011-02-01.1upstream/2011-02-01.1Ondřej Surý2-41/+4
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý4-73/+99
2010-04-15flag: eliminate unnecessary structsRuss Cox1-48/+32
R=r CC=golang-dev http://codereview.appspot.com/872045
2010-04-06flags: better tests.Rob Pike2-18/+138
R=rsc CC=golang-dev http://codereview.appspot.com/864044
2010-03-30simplify various code using new map index ruleRuss Cox1-5/+1
R=r CC=golang-dev http://codereview.appspot.com/833044
2010-03-29Flags: add user-defined flag types. The change is really no code; it's just ↵Rob Pike2-45/+64
publishing the set() method and add() functions. But we rename add() to Var() for consistency. Also rename FlagValue to Value for simplicity. Also, delete the check for multiple settings for a flag. This makes it possible to define a flag that collects values, such as into a slice of strings. type flagVar []string func (f *flagVar) String() string { return fmt.Sprint(v) } func (f *flagVar) Set(value string) bool { if v == nil { v = make(flagVar, 1) } else { nv := make(flagVar, len(v)+1) copy(nv, v) v = nv } v[len(v)-1] = value return true } var v flagVar func main() { flag.Var(&v, "testV", "multiple values build []string") flag.Parse() fmt.Printf("v = %v\n", v) } R=rsc CC=golang-dev http://codereview.appspot.com/842041
2010-03-25Add strconv.Atob, Btoa.Rob Pike1-13/+2
Fixes issue 639 R=rsc CC=golang-dev http://codereview.appspot.com/755041
2009-12-15 1) Change default gofmt default settings forRobert Griesemer2-188/+188
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 2nd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/179067
2009-11-23go: makes it build for the case $GOROOT has whitespacesSergio Luis O. B. Correia1-2/+2
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
2009-11-20gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkgRuss Cox1-3/+3
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
2009-11-13Explain whyRob Pike1-1/+6
-flag true does not work although -flag=true does. Fixes issue 139. R=iant CC=golang-dev http://codereview.appspot.com/154118
2009-11-09 - replaced gofmt expression formatting algorithm withRobert Griesemer1-4/+4
rsc's algorithm - applied gofmt -w misc src - partial CL (remaining files in other CLs) R=rsc, r http://go/go-review/1026036
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer2-31/+31
R=rsc, r http://go/go-review/1025029
2009-11-07Add flags of type float to the flag package.Vish Subramanian2-2/+71
R=r, rsc http://go/go-review/1026011 Committer: Rob Pike <r@golang.org>
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer1-27/+9
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-11-05gofmt-ify template, time, unsafe, flag, fmtRobert Griesemer2-3/+3
(replacement for CLs 1017039, 1017041, 1017040, 1018054) R=r http://go/go-review/1018060
2009-10-08more lgtm files from gofmtRuss Cox1-2/+2
R=gri OCL=35485 CL=35488
2009-10-06apply gofmt to datafmt, ebnf, exec, expvar, flag, fmtRuss Cox2-77/+76
R=gri DELTA=456 (6 added, 3 deleted, 447 changed) OCL=35398 CL=35406
2009-09-17unused importsRuss Cox1-1/+0
R=r OCL=34731 CL=34731
2009-09-15more "declared and not used".Russ Cox1-4/+4
the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638
2009-08-12delete forward type declarationsRuss Cox1-9/+0
R=r DELTA=163 (1 added, 149 deleted, 13 changed) OCL=33106 CL=33111
2009-08-12convert low-level (used by testing) packages toRuss Cox3-78/+29
whole-package compilation. new Makefiles, tests now in separate package bytes flag fmt io math once os reflect strconv sync time utf8 delete import "xxx" in package xxx. inside package xxx, xxx is not declared anymore so s/xxx.//g delete file and package level forward declarations. note the new internal_test.go and sync and strconv to provide public access to internals during testing. the installed version of the package omits that file and thus does not open the internals to all clients. R=r OCL=33065 CL=33097
2009-07-16fix up prints in flag.goRob Pike1-11/+11
R=rsc DELTA=11 (0 added, 0 deleted, 11 changed) OCL=31760 CL=31760
2009-07-14allow user to override the Usage functionRob Pike1-9/+10
R=gri DELTA=15 (6 added, 5 deleted, 4 changed) OCL=31649 CL=31649
2009-07-01clean up some BUG/TODO in go codeRuss Cox1-1/+1
R=r DELTA=23 (1 added, 12 deleted, 10 changed) OCL=30957 CL=30980
2009-06-22a couple of cosmetic tweaks.Rob Pike1-2/+2
R=rsc DELTA=2 (0 added, 0 deleted, 2 changed) OCL=30599 CL=30602
2009-06-09mv src/lib to src/pkgRob Pike3-0/+623
tests: all.bash passes, gobuild still works, godoc still works. R=rsc OCL=30096 CL=30102