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

Issue 6165044: Add hopefully-reusable --output and --format flags to config-get

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by fwereade
Modified:
12 years ago
Reviewers:
mp+104410
Visibility:
Public.

Description

Add hopefully-reusable --output and --format flags to config-get Format defaults to "smart", as in python, but does not produce the same output: it produces go-specific stringifications rather than python-specific ones. Since "smart" python output was clearly never intended to be (easily) machine-readable (or it would have used repr) this has been agreed to be equivalent enough. https://code.launchpad.net/~fwereade/juju/go-config-get-command-flags/+merge/104410 Requires: https://code.launchpad.net/~fwereade/juju/go-config-get-command-start/+merge/104370 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 14

Patch Set 2 : Add hopefully-reusable --output and --format flags to config-get #

Total comments: 13

Patch Set 3 : Add hopefully-reusable --output and --format flags to config-get #

Total comments: 2

Patch Set 4 : Add hopefully-reusable --output and --format flags to config-get #

Unified diffs Side-by-side diffs Delta from patch set Stats (+169 lines, -6 lines) Patch
A [revision details] View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/jujuc/server/config-get.go View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M cmd/jujuc/server/config-get_test.go View 1 2 3 4 chunks +47 lines, -3 lines 0 comments Download
A cmd/jujuc/server/output.go View 1 2 3 1 chunk +117 lines, -0 lines 0 comments Download

Messages

Total messages: 11
fwereade
Please take a look.
12 years ago (2012-05-02 16:08:20 UTC) #1
rog
i appreciate the idea, and i was initially +1, but after reflection i'm not sure ...
12 years ago (2012-05-02 17:05:52 UTC) #2
fwereade
On 2012/05/02 17:05:52, rog wrote: > i appreciate the idea, and i was initially +1, ...
12 years ago (2012-05-02 17:14:52 UTC) #3
fwereade
Please take a look. https://codereview.appspot.com/6165044/diff/1/cmd/jujuc/server/output.go File cmd/jujuc/server/output.go (right): https://codereview.appspot.com/6165044/diff/1/cmd/jujuc/server/output.go#newcode15 cmd/jujuc/server/output.go:15: type converters map[string]converter On 2012/05/02 ...
12 years ago (2012-05-02 17:27:44 UTC) #4
rog
On 2012/05/02 17:14:52, fwereade wrote: > On 2012/05/02 17:05:52, rog wrote: > > i appreciate ...
12 years ago (2012-05-02 17:47:48 UTC) #5
rog
https://codereview.appspot.com/6165044/diff/1/cmd/jujuc/server/output.go File cmd/jujuc/server/output.go (right): https://codereview.appspot.com/6165044/diff/1/cmd/jujuc/server/output.go#newcode71 cmd/jujuc/server/output.go:71: func (v *converterValue) write(target io.Writer, value interface{}) (err error) ...
12 years ago (2012-05-02 17:50:39 UTC) #6
niemeyer
LGTM, assuming the following is sorted: https://codereview.appspot.com/6165044/diff/1006/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go (right): https://codereview.appspot.com/6165044/diff/1006/cmd/jujuc/server/config-get.go#newcode37 cmd/jujuc/server/config-get.go:37: "smart": convertSmart, This ...
12 years ago (2012-05-03 01:18:47 UTC) #7
niemeyer
https://codereview.appspot.com/6165044/diff/1006/cmd/jujuc/server/output.go File cmd/jujuc/server/output.go (right): https://codereview.appspot.com/6165044/diff/1006/cmd/jujuc/server/output.go#newcode71 cmd/jujuc/server/output.go:71: func (v *converterValue) write(target io.Writer, value interface{}) (err error) ...
12 years ago (2012-05-03 01:24:48 UTC) #8
fwereade
Please take a look. https://codereview.appspot.com/6165044/diff/1006/cmd/jujuc/server/config-get.go File cmd/jujuc/server/config-get.go (right): https://codereview.appspot.com/6165044/diff/1006/cmd/jujuc/server/config-get.go#newcode37 cmd/jujuc/server/config-get.go:37: "smart": convertSmart, On 2012/05/03 01:18:47, ...
12 years ago (2012-05-03 10:26:45 UTC) #9
niemeyer
LGTM, thanks. A trivial detail, FWIW: https://codereview.appspot.com/6165044/diff/12001/cmd/jujuc/server/output.go File cmd/jujuc/server/output.go (right): https://codereview.appspot.com/6165044/diff/12001/cmd/jujuc/server/output.go#newcode106 cmd/jujuc/server/output.go:106: var bytes []byte ...
12 years ago (2012-05-03 17:46:50 UTC) #10
fwereade
12 years ago (2012-05-04 08:05:15 UTC) #11
*** Submitted:

Add hopefully-reusable --output and --format flags to config-get

Format defaults to "smart", as in python, but does not produce the same
output: it produces go-specific stringifications rather than python-specific
ones. Since "smart" python output was clearly never intended to be (easily)
machine-readable (or it would have used repr) this has been agreed to be
equivalent enough.

R=rog, niemeyer
CC=
https://codereview.appspot.com/6165044

https://codereview.appspot.com/6165044/diff/12001/cmd/jujuc/server/output.go
File cmd/jujuc/server/output.go (right):

https://codereview.appspot.com/6165044/diff/12001/cmd/jujuc/server/output.go#...
cmd/jujuc/server/output.go:106: var bytes []byte
On 2012/05/03 17:46:50, niemeyer wrote:
> That's not necessary. Just do "bytes, err :=" below and it will work properly
> with everything else unchanged.

Done.
Sign in to reply to this message.

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