From 41fbfc1691b4e7fa3dbb0b7cf5b557c4375dbdc8 Mon Sep 17 00:00:00 2001 From: Brad Garropy Date: Sat, 4 Jan 2020 13:41:30 -0600 Subject: [PATCH 1/2] bump version. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e3c73ea..3122592 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "labman", - "version": "0.7.0", + "version": "0.8.0", "description": "👨🏼‍🔬 github label manager cli", "keywords": [ "github", From c3f82af25b0213f36548390ea445fa4e79da7336 Mon Sep 17 00:00:00 2001 From: Brad Garropy Date: Sat, 4 Jan 2020 13:48:28 -0600 Subject: [PATCH 2/2] add commands to readme. closes #40. --- readme.md | 93 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 84 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index db535fa..80cb934 100644 --- a/readme.md +++ b/readme.md @@ -19,25 +19,100 @@ npm install labman --global If you have `labman` installed globally you can run it as shown below. ``` -labman login -labman +labman --help ``` -Where `token` is a GitHub [personal access token][token] with `repo` scope. -Where `source` and `destination` are GitHub repositories in the form of `owner/repo`. +Alternatively, you can run it with [`npx`][npx]. + +``` +npx labman --help +``` + +## 👨🏼‍🏫 Commands + +### `login` + +Validates and stores your GitHub [personal access token][token]. + +#### Options + +| Name | Description | Default | +| --------------- | -------------------------------------------------------- | ------- | +| `username` | GitHub username. | | +| `token` | GitHub [personal access token][token] with `repo` scope. | | +| `--force`, `-f` | Overwrite existing login. | `false` | + +#### Examples + +Login as `bradgarropy` with a [personal access token][token]. + +``` +labman login bradgarropy 123456 +``` + +Login as `gabygarropy`, overwriting the `bradgarropy` login. + +``` +labman login gabygarropy 456789 +``` + +### `default` + +Copies labels from one repository to another. + +The `source` and `destination` can be provided in two ways. -Here is an example. +- `owner/repo`, like `bradgarropy/labman-cli` +- `repo`, like `labman-cli` + +If an `owner` is not specified, `labman` will assume the `username` you provided during `login`. + +If `labels` is not provided, `labman` will copy all labels from `source` to `destination`. + +#### Options + +| Name | Description | Default | +| ----------------- | -------------------------------------------------------------------- | ------- | +| `source` | GitHub repository. | | +| `destination` | GitHub repository. | | +| `labels` | Space separated list of label names to copy. | `[]` | +| `--clobber`, `-c` | Remove all labels from `destination` before copying `source` labels. | `false` | + +#### Examples + +Copy all labels from `bradgarropy/label-source` to `bradgarropy/label-destination`. ``` -labman login bradgarropy 1234abcd labman bradgarropy/label-source bradgarropy/label-destination ``` -Alternatively, you can run it with [`npx`][npx]. +Delete all labels from `bradgarropy/label-destionation`, then copy all labels from `bradgarropy/label-source` to `bradgarropy/label-destination`. + +``` +labman bradgarropy/label-source bradgarropy/label-destination --clobber +``` + +Copy only the `bug` and `todo` labels from `bradgarropy/label-source` to `bradgarropy/label-destination`. + +``` +labman bradgarropy/label-source bradgarropy/label-destination bug todo +``` + +Use the shorthand method for providing `source` and `destination` repositories. + +``` +labman login bradgarropy 123456 +labman label-source label-destination +``` + +### `logout` + +Removes your GitHub [personal access token][token]. + +#### Examples ``` -npx labman login -npx labman +labman logout ``` ## ❔ Questions