Skip to content
This repository was archived by the owner on Jan 27, 2022. It is now read-only.

Commit 26a8a2e

Browse files
authored
Merge pull request #21 from tonglil/update-docs
Update docs
2 parents 730a613 + 1eec4eb commit 26a8a2e

1 file changed

Lines changed: 24 additions & 16 deletions

File tree

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@ Get binaries for OS X / Linux / Windows from the latest [release].
3737
Or use `go get`:
3838

3939
```
40-
go get github.com/tonglil/labeler
40+
go get -u github.com/tonglil/labeler
4141
```
4242

4343
[release]: https://github.com/tonglil/labeler/releases
4444

4545
## Usage
4646

4747
First, set a [GitHub token][tokens] in the environment (optional, the token can be set as an cli argument as well).
48+
4849
```
4950
export GITHUB_TOKEN=xxx
5051
```
@@ -58,7 +59,7 @@ export GITHUB_TOKEN=xxx
5859

5960
To scan existing labels from a repository and save it to a file:
6061
```
61-
labeler -v 5 -scan -repo owner/name labels.yaml
62+
labeler scan labels.yaml --repo owner/name
6263
```
6364

6465
Which when run against a "new" repo created on GitHub, will:
@@ -75,7 +76,7 @@ And write them into `labels.yaml`, creating the file if it exists, otherwise ove
7576

7677
To apply labels to a repository:
7778
```
78-
labeler -v 5 labels.yaml
79+
labeler apply labels.yaml --dryrun
7980
```
8081

8182
Where `labels.yaml` is like:
@@ -108,29 +109,36 @@ In this manner, this tool is idempotent.
108109
## Usage options
109110

110111
```
111-
usage: labeler [<options>] <file.yaml>
112-
```
112+
$ labeler
113+
Labeler is a CLI application for managing labels on Github as code.
114+
115+
With the ability to scan and apply label changes, repository maintainers can
116+
empower contributors to submit PRs and improve the project management
117+
process/label system!
113118

114-
Notable options:
115-
- `-scan` - scan a repo for label information into a file
116-
- `-dry-run` - show what would happen (default false)
117-
- `-v <0 to 9>` - log level for V logs (default 0)
118-
- `-endpoint <https://url/>` - use a different GithHub API endpoint [overrides GITHUB_API environment variable] (default "https://api.github.com/")
119-
- `-repo <owner/name>` - use a different repository (default "from file")
120-
- `-token <string>` - use a different GithHub token [overrides GITHUB_TOKEN environment variable]
121-
- `-version` - show version
119+
Usage:
120+
labeler [command]
122121

123-
Get all options by running:
122+
Available Commands:
123+
apply Apply a YAML label definition file
124+
completion Output shell completion code for tab completion
125+
scan Save a repository's labels into a YAML definition file
126+
version Print the version information
127+
128+
Use "labeler [command] --help" for more information about a command.
124129
```
125-
labeler -h
130+
131+
## Tab completion
132+
133+
```bash
134+
source <(labeler completion)
126135
```
127136

128137
## Development
129138

130139
[`glide`][glide] is used to manage vendor dependencies.
131140

132141
Roadmap:
133-
- Refactor cli (https://github.com/tonglil/labeler/issues/5).
134142
- Plan -> execute (aka always dry-run first).
135143
- Automatically update file after renaming operations are complete.
136144
- Organizational support (apply/only-add one config to all repos in an organization).

0 commit comments

Comments
 (0)