-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve CLI Text by Adding Verbose Text for Commands #68
Open
rtadepalli
wants to merge
2
commits into
apache:main
Choose a base branch
from
rtadepalli:improve-cli-help-text
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,16 +34,21 @@ import ( | |
const usage = `iceberg. | ||
|
||
Usage: | ||
iceberg list [options] [PARENT] | ||
iceberg describe [options] [namespace | table] IDENTIFIER | ||
iceberg (schema | spec | uuid | location) [options] TABLE_ID | ||
iceberg drop [options] (namespace | table) IDENTIFIER | ||
iceberg files [options] TABLE_ID [--history] | ||
iceberg rename [options] <from> <to> | ||
iceberg properties [options] get (namespace | table) IDENTIFIER [PROPNAME] | ||
iceberg properties [options] set (namespace | table) IDENTIFIER PROPNAME VALUE | ||
iceberg properties [options] remove (namespace | table) IDENTIFIER PROPNAME | ||
iceberg -h | --help | --version | ||
iceberg [command] [options] [arguments] | ||
iceberg -h | --help | ||
iceberg --version | ||
|
||
Commands: | ||
describe Describe a namespace or a table. | ||
list List tables or namespaces. | ||
schema Get the schema of the table. | ||
spec Return the partition spec of the table. | ||
uuid Return the UUID of the table. | ||
location Return the location of the table. | ||
drop Operations to drop a namespace or table. | ||
files List all the files of the table. | ||
rename Rename a table. | ||
properties Properties on tables/namespaces. | ||
|
||
Arguments: | ||
PARENT Catalog parent namespace | ||
|
@@ -53,12 +58,22 @@ Arguments: | |
VALUE value to set | ||
|
||
Options: | ||
-h --help show this helpe messages and exit | ||
--catalog TEXT specify the catalog type [default: rest] | ||
--uri TEXT specify the catalog URI | ||
--output TYPE output type (json/text) [default: text] | ||
--credential TEXT specify credentials for the catalog | ||
--warehouse TEXT specify the warehouse to use` | ||
--warehouse TEXT specify the warehouse to use | ||
|
||
Example Usages | ||
iceberg list [options] [PARENT] | ||
iceberg describe [options] [namespace | table] IDENTIFIER | ||
iceberg (schema | spec | uuid | location) [options] TABLE_ID | ||
iceberg drop [options] (namespace | table) IDENTIFIER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kept the existing set of usages because this line for example has |
||
iceberg files [options] TABLE_ID [--history] | ||
iceberg rename [options] <from> <to> | ||
iceberg properties [options] get (namespace | table) IDENTIFIER [PROPNAME] | ||
iceberg properties [options] set (namespace | table) IDENTIFIER PROPNAME VALUE | ||
iceberg properties [options] remove (namespace | table) IDENTIFIER PROPNAME` | ||
|
||
func main() { | ||
args, err := docopt.ParseArgs(usage, os.Args[1:], iceberg.Version()) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this actually work? The library being used
docopt
actually uses theusage
string to perform the parsing and processing.[options]
is a special handle thing for docopt, but i don't think that[command]
and[arguments]
is. So i think this might break the CLI hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zeroshade Apologies, this slipped through my radar. I don't think that this is breaking the CLI:
I tested this before putting up the PR -- unless I am misunderstanding what you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's for the help, did you confirm that it works just fine for the regular usages of calling list/describe/files/etc.? it's just a usage for docopt i hadnt seen before