You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/06/04 01:38:19 UTC
[GitHub] sijie opened a new pull request #1471: Abstract the tools framework
to allow merging multiple CLI tools together
sijie opened a new pull request #1471: Abstract the tools framework to allow merging multiple CLI tools together
URL: https://github.com/apache/bookkeeper/pull/1471
Descriptions of the changes in this PR:
*Motivation*
There are multiple CLI tools spreading across multiple places, e.g. new bookkeeper cli, stream storage cli and dlog. There have similar implementations. It would be better to consolidate all these tools in one place `bookkeeper-tools`.
This is a PR to prepare moving `stream/cli` to be part of bookkeeper-tools.
*Solution*
- Abstract the CLI logic in bookkeeper-tools into a simple tools framework that can be reused in a extensible way to unify multiple tools together.
- organize the tools module into tools/framework and tools/all
*Result*
Example output of the tool using this framework is listed as below:
```
$ bin/bkctl
bkctl interacts and operates Apache BookKeeper clusters
Usage: bkctl [flags] [command group] [commands]
Commands:
bookie Commands on operating a single bookie
bookies Commands on operating a cluster of bookies
cluster Commands on administrating bookkeeper clusters
ledger Commands on interacting with ledgers
namespace Commands on operating namespaces
table Commands on interacting with tables
tables Commands on operating tables
help Display help information about it
Flags:
-c, --conf
Configuration file
-n, --namespace
Namespace scope to run commands (only valid for table service for now)
-u, --service-uri
Service Uri
-h, --help
Display help information
Use "bkctl [command] --help" or "bkctl help [command]" for more information
about a command
```
*result from help sub-command*
```
$ bin/bkctl help table
Commands on interacting with tables
Usage: bkctl table [command] [command options]
Commands:
get Get key/value pair from a table
inc Increment the amount of a key in a table
put Put key/value pair to a table
help Display help information about it
Use "bkctl table [command] --help" or "bkctl table help [command]" for more
information about a command
```
*result from help sub-sub-command*
```
$ bin/bkctl table help inc
Increment the amount of a key in a table
Usage: bkctl table inc [flags] <table> <key> <amount>
Flags:
-h, --help
Display help information
```
Master Issue: #1000
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services