You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Todd Lipcon (Code Review)" <ge...@cloudera.org> on 2016/08/18 06:41:49 UTC

[kudu-CR] tool: improve help output

Hello Adar Dembo,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/4038

to review the following change.

Change subject: tool: improve help output
......................................................................

tool: improve help output

- adds blank line in between usage summary and more detail
- better formatting for required parameters in usage
- better formatting for optional boolean parameters
- justify the list of subcommands

Example output with subcommands:

Usage: ./build/latest/bin/kudu <command> [<args>]

<command> can be one of the following:
      fs   Operate on a local Kudu filesystem
     pbc   Operate on a PBC (protobuf container) files
  tablet   Operate on a local Kudu replica

Example output of a leaf node:

Usage: ./build/latest/bin/kudu pbc dump <path> [-oneline]

Dump a PBC (protobuf container) file
    path (path to PBC file) type: string default: ""
    -oneline (print each protobuf on a single line) type: bool default: false

Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
---
M src/kudu/tools/tool_action.cc
1 file changed, 38 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/38/4038/1
-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>

[kudu-CR] tool: improve help output

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/4038/1/src/kudu/tools/tool_action.cc
File src/kudu/tools/tool_action.cc:

Line 96:   msg << "<command> can be one of the following:\n";
> but then it would be lined up with the subcommands. Or you think I should i
I think that's perfectly fine, no need for the proposed indent.  The idea of an extra-spacing was inspired by valgrind and some other programs.

Moreover, this change has been already committed :)


-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] tool: improve help output

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has submitted this change and it was merged.

Change subject: tool: improve help output
......................................................................


tool: improve help output

- adds blank line in between usage summary and more detail
- better formatting for required parameters in usage
- better formatting for optional boolean parameters
- justifies the list of subcommands

Example output with subcommands:

Usage: ./build/latest/bin/kudu <command> [<args>]

<command> can be one of the following:
      fs   Operate on a local Kudu filesystem
     pbc   Operate on a PBC (protobuf container) files
  tablet   Operate on a local Kudu replica

Example output of a leaf node:

Usage: ./build/latest/bin/kudu pbc dump <path> [-oneline]

Dump a PBC (protobuf container) file
    path (path to PBC file) type: string default: ""
    -oneline (print each protobuf on a single line) type: bool default: false

Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Reviewed-on: http://gerrit.cloudera.org:8080/4038
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Todd Lipcon <to...@apache.org>
---
M src/kudu/tools/tool_action.cc
1 file changed, 38 insertions(+), 13 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Todd Lipcon: Verified



-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] tool: improve help output

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 2: Code-Review+2

-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] tool: improve help output

Posted by "Adar Dembo (Code Review)" <ge...@cloudera.org>.
Adar Dembo has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 1: Code-Review+2

(1 comment)

http://gerrit.cloudera.org:8080/#/c/4038/1/src/kudu/tools/tool_action.cc
File src/kudu/tools/tool_action.cc:

Line 109:   for (const auto& p : lines) {
Nit: shouldn't it be 'l' for 'line'? Or does 'p' mean something else?


-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: Yes

[kudu-CR] tool: improve help output

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 1:

(5 comments)

http://gerrit.cloudera.org:8080/#/c/4038/1//COMMIT_MSG
Commit Message:

Line 9: - adds blank line in between usage summary and more detail
> nit for consistency: adds --> add, or justify --> justifies below instead
Done


http://gerrit.cloudera.org:8080/#/c/4038/1/src/kudu/tools/tool_action.cc
File src/kudu/tools/tool_action.cc:

Line 94:   std::stringstream msg;
> nit: std::ostringstream since no input is assumed.
Done


PS1, Line 95: [<args>]
> nit: if here we are using mandatory/optional notation with <>/[] brackets, 
Just copied this from git's usage output. I think we would use: '[--foo]' if "--foo" was the literal string that's optional, whereas here we're saying '[<args>'] because <args> itself is a place-holder for something else


Line 96:   msg << "<command> can be one of the following:\n";
> nit: "  <command> ..."  i.e. add a couple of spaces for better readability 
but then it would be lined up with the subcommands. Or you think I should indent the subcommands even more?

Again copied from git's format:

todd@todd-ThinkPad-T540p:~/git/kudu$ git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
...


Line 109:   for (const auto& p : lines) {
> Nit: shouldn't it be 'l' for 'line'? Or does 'p' mean something else?
was using 'p' for 'pair'. will rename lines to line_pairs and the variable to 'lp'


-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: Yes

[kudu-CR] tool: improve help output

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 1:

Build Started http://104.196.14.100/job/kudu-gerrit/2977/

-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: No

[kudu-CR] tool: improve help output

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Todd Lipcon has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 2: Verified+1

unrelated java flake

-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No

[kudu-CR] tool: improve help output

Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 1: Code-Review+1

(4 comments)

http://gerrit.cloudera.org:8080/#/c/4038/1//COMMIT_MSG
Commit Message:

Line 9: - adds blank line in between usage summary and more detail
nit for consistency: adds --> add, or justify --> justifies below instead


http://gerrit.cloudera.org:8080/#/c/4038/1/src/kudu/tools/tool_action.cc
File src/kudu/tools/tool_action.cc:

Line 94:   std::stringstream msg;
nit: std::ostringstream since no input is assumed.


PS1, Line 95: [<args>]
nit: if here we are using mandatory/optional notation with <>/[] brackets, what [<args>] would mean?  I would expect it to be just $0 <command> [args] instead.


Line 96:   msg << "<command> can be one of the following:\n";
nit: "  <command> ..."  i.e. add a couple of spaces for better readability in the beginning of the line.


-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-HasComments: Yes

[kudu-CR] tool: improve help output

Posted by "Todd Lipcon (Code Review)" <ge...@cloudera.org>.
Hello Adar Dembo, Alexey Serbin, Kudu Jenkins,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/4038

to look at the new patch set (#2).

Change subject: tool: improve help output
......................................................................

tool: improve help output

- adds blank line in between usage summary and more detail
- better formatting for required parameters in usage
- better formatting for optional boolean parameters
- justifies the list of subcommands

Example output with subcommands:

Usage: ./build/latest/bin/kudu <command> [<args>]

<command> can be one of the following:
      fs   Operate on a local Kudu filesystem
     pbc   Operate on a PBC (protobuf container) files
  tablet   Operate on a local Kudu replica

Example output of a leaf node:

Usage: ./build/latest/bin/kudu pbc dump <path> [-oneline]

Dump a PBC (protobuf container) file
    path (path to PBC file) type: string default: ""
    -oneline (print each protobuf on a single line) type: bool default: false

Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
---
M src/kudu/tools/tool_action.cc
1 file changed, 38 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/38/4038/2
-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>

[kudu-CR] tool: improve help output

Posted by "Kudu Jenkins (Code Review)" <ge...@cloudera.org>.
Kudu Jenkins has posted comments on this change.

Change subject: tool: improve help output
......................................................................


Patch Set 2:

Build Started http://104.196.14.100/job/kudu-gerrit/3028/

-- 
To view, visit http://gerrit.cloudera.org:8080/4038
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b4fc2da2b03edf8ce6b9998eeabd06a4fcd216d
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <to...@apache.org>
Gerrit-Reviewer: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <to...@apache.org>
Gerrit-HasComments: No