improve the USAGE section

This commit is contained in:
Timothy Andrew 2020-06-18 11:08:59 +05:30
parent 69e88a7457
commit cd564736f3
No known key found for this signature in database
GPG Key ID: ABD64509E977B249
1 changed files with 17 additions and 4 deletions

View File

@ -29,25 +29,38 @@ WIt then looks for all PRs containing this containing this identifier and builds
```bash ```bash
$ export GHSTACK_OAUTH_TOKEN='<personal access token>' $ export GHSTACK_OAUTH_TOKEN='<personal access token>'
$ gh-stack
USAGE:
gh-stack <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
SUBCOMMANDS:
annotate Annotate the descriptions of all PRs in a stack with metadata about all PRs in the stack
autorebase Rebuild a stack based on changes to local branches and mirror these changes up to the remote
log Print a list of all pull requests in a stack to STDOUT
rebase Print a bash script to STDOUT that can rebase/update the stack (with a little help)
# Idempotently add a markdown table summarizing the stack # Idempotently add a markdown table summarizing the stack
# to the description of each PR in the stack. # to the description of each PR in the stack.
$ gh-stack github 'stack-identifier' $ gh-stack annotate 'stack-identifier'
# Same as above, but precede the markdown table with the # Same as above, but precede the markdown table with the
# contents of `filename.txt`. # contents of `filename.txt`.
$ gh-stack github 'stack-identifier' filename.txt $ gh-stack annotate 'stack-identifier' -p filename.txt
# Print a description of the stack to stdout. # Print a description of the stack to stdout.
$ gh-stack log 'stack-identifier' $ gh-stack log 'stack-identifier'
# Automatically update the entire stack, both locally and remotely. # Automatically update the entire stack, both locally and remotely.
# WARNING: This operation modifies local branches and force-pushes. # WARNING: This operation modifies local branches and force-pushes.
$ gh-stack autorebase 'stack-identifier' /path/to/repo $ gh-stack autorebase 'stack-identifier' -C /path/to/repo
# Emit a bash script that can update a stack in the case of conflicts. # Emit a bash script that can update a stack in the case of conflicts.
# WARNING: This script could potentially cause destructive behavior. # WARNING: This script could potentially cause destructive behavior.
$ gh-stack rebase 'stack-identifier' $ gh-stack rebase 'stack-identifier'
``` ```
## Strategy ## Strategy