Skip to content

Commit

Permalink
Improve Usage Output
Browse files Browse the repository at this point in the history
  • Loading branch information
jenslauterbach committed May 30, 2021
1 parent d459b1f commit ee537b1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
41 changes: 20 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
- [Usage](#usage)
- [Quick Start](#quick-start)
- [Permissions](#permissions)
- [Flags and Arguments](#flags-and-arguments)
- [AWS Cost](#aws-cost)
- [Design Goals](#design-goals)
- [Versioning](#versioning)
Expand Down Expand Up @@ -66,28 +65,28 @@ The build will create a new binary called `ddbt`.
To truncate a DynamoDB table the only required _argument_ is the name of the table. Everything else can be controlled through options (also called flags):

````shell script
ddbt [options...] <table-name>
Usage: ddbt [options...] <table-name>

Options:
-d, --debug Show debug information
--dry-run Simulate truncating table
--endpoint-url <url> Custom endpoint url (overwrite default endpoint)
-h, --help This help text
--max-retries <retries> Maximum number of retries (default: 3)
--no-input Do not require any input
--no-color Disable colored output
-p, --profile <profile> AWS profile to use
-q, --quiet Disable all output (except for required input)
-r, --region <region> AWS region of DynamoDB table (overwrite default region)
--version Show version number and quit

Examples:

$ ddbt TestTable
$ ddbt --region eu-central-1 TestTable
$ ddbt --region localhost --endpoint-url http://localhost:8000 TestTable
````

See chapter [Flags and Arguments](#flags-and-arguments) for an overview of all available flags.

## Flags and Arguments
[(Back to top)](#table-of-contents)

| Option | Description |
|:---|:---|
|--debug|Show debug information|
|--dry-run|Simulate truncating table|
|--endpoint-url|Custom endpoint url (overwrite default endpoint)|
|--help|Show help text|
|--max-retries|Maximum number of retries (default: 3)|
|--no-input|Do not require any input|
|--no-color|Disable colored output|
|--profile|AWS profile to use|
|--quiet|Disable all output (except for required input)|
|--region|AWS region of DynamoDB table (overwrite default region)|
|--version|Show version number and quit|

## Quick Start
[(Back to top)](#table-of-contents)

Expand Down
8 changes: 7 additions & 1 deletion cmd/ddbt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@ Options:
-d, --debug Show debug information
--dry-run Simulate truncating table
--endpoint-url <url> Custom endpoint url (overwrite default endpoint)
-h, --help This help text
-h, --help Show this help text
--max-retries <retries> Maximum number of retries (default: 3)
--no-input Do not require any input
--no-color Disable colored output
-p, --profile <profile> AWS profile to use
-q, --quiet Disable all output (except for required input)
-r, --region <region> AWS region of DynamoDB table (overwrite default region)
--version Show version number and quit
Examples:
$ ddbt TestTable
$ ddbt --region eu-central-1 TestTable
$ ddbt --region localhost --endpoint-url http://localhost:8000 TestTable
`
)

Expand Down

0 comments on commit ee537b1

Please sign in to comment.