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

Issue 6100050: SuperCommand now just handles subcommand selection

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by fwereade
Modified:
12 years, 11 months ago
Reviewers:
niemeyer, mp+103065
Visibility:
Public.

Description

SuperCommand now just handles subcommand selection ...and LoggingSuperCommand embeds it, and adds logging flags, as before. https://code.launchpad.net/~fwereade/juju/go-split-supercommand/+merge/103065 Requires: https://code.launchpad.net/~fwereade/juju/go-recurse-parse-directly/+merge/103064 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -197 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cmd/context.go View 2 chunks +0 lines, -22 lines 0 comments Download
M cmd/context_test.go View 2 chunks +0 lines, -49 lines 0 comments Download
M cmd/juju/main.go View 1 chunk +1 line, -1 line 0 comments Download
M cmd/jujud/main.go View 1 chunk +1 line, -1 line 0 comments Download
A cmd/logging.go View 1 chunk +55 lines, -0 lines 0 comments Download
A cmd/logging_test.go View 1 chunk +121 lines, -0 lines 0 comments Download
M cmd/supercommand.go View 4 chunks +10 lines, -23 lines 1 comment Download
M cmd/supercommand_test.go View 2 chunks +0 lines, -101 lines 0 comments Download

Messages

Total messages: 3
fwereade
Please take a look.
12 years, 11 months ago (2012-04-23 09:26:07 UTC) #1
niemeyer
https://codereview.appspot.com/6100050/diff/1/cmd/supercommand.go File cmd/supercommand.go (right): https://codereview.appspot.com/6100050/diff/1/cmd/supercommand.go#newcode12 cmd/supercommand.go:12: // again on itself, passing in any remaining command ...
12 years, 11 months ago (2012-04-23 23:25:43 UTC) #2
fwereade
12 years, 11 months ago (2012-04-24 08:15:12 UTC) #3
Heh, according to my own definition, splitting off the selection is exactly what
I did.

The choices I can see are:

* original: unified type with a flag to disable logging.
* current: SuperCommand has been "split off" and can now be used on its own (for
cmd/jujuc/server); and it's also embedded in LoggingSuperCommand.
* ravioli: create separate LoggingCommand and SuperCommand; embed them both in
LoggingSuperCommand.

Each of these allows for easy-enough creation of commands that either expose
subcommands with logging flags or just expose subcommands. There's no current
use case for just exposing logging flags, so I dismissed the [ravioli] solution
as overengineering; but I'd be more than happy to do it that way.

Was that your original intent, or have I missed something? Because I don't think
the converse of [current] makes sense: splitting out a separate LoggingCommand
inevitably leads to either [ravioli] or a variant of [original], because we need
selector types both with and without logging flags.

Right..?
Sign in to reply to this message.

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