Skip to content

Commit

Permalink
Update README; print usage when too few arguments are given
Browse files Browse the repository at this point in the history
  • Loading branch information
mrngm committed Oct 27, 2018
1 parent 0d6e77e commit 076b82b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ software for the time being.

![I have no idea what I'm doing](https://user-images.githubusercontent.com/519171/45828811-7f984700-bcc7-11e8-8ff5-114ff55d9014.gif)


## Usage

### Preliminaries

```shell
go get github.com/octokit/go-octokit/octokit
go build
```

### Running `go-make-labels`

Populate label configuration in `example.json` and run

```shell
export OCTOKIT_ACCESS_TOKEN=1234567890
go run main.go "kylemacey/go-make-labels"
OCTOKIT_ACCESS_TOKEN=1234567890 ./go-make-labels "kylemacey/go-make-labels"
```
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import (
)

func main() {
if len(os.Args) != 2 {
fmt.Printf("Usage: %s <user/repository>\n\n", os.Args[0])
fmt.Println("Don't forget to set the environment variable OCTOKIT_ACCESS_TOKEN.")
return
}

client := octokit.NewClient(getAuthMethod())

labels, result := client.Labels().All(nil, getRepoParams())
Expand Down

0 comments on commit 076b82b

Please sign in to comment.