Skip to content

Commit 86c66e9

Browse files
author
Chris Hunt
committed
Update README with new usage instructions
1 parent 599e5d4 commit 86c66e9

1 file changed

Lines changed: 28 additions & 17 deletions

File tree

README.md

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,36 @@ After you've [installed](#installation) `gh-auth`, you can give me ssh access
2323
with:
2424

2525
```bash
26-
$ gh-auth add chrishunt
26+
$ gh-auth --add chrishunt
2727
Adding 2 key(s) to '/Users/chris/.ssh/authorized_keys'
2828
```
2929

3030
That was easy! When we're done working, you can revoke my access with:
3131

3232
```bash
33-
$ gh-auth remove chrishunt
33+
$ gh-auth --remove chrishunt
3434
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
3535
```
3636

3737
You can add and remove any number of users at the same time.
3838

3939
```bash
40-
$ gh-auth add chrishunt zachmargolis
40+
$ gh-auth --add chrishunt,zachmargolis
4141
Adding 4 key(s) to '/Users/chris/.ssh/authorized_keys'
4242

43-
$ gh-auth list
43+
$ gh-auth --list
4444
Added users: chrishunt, zachmargolis
4545

46-
$ gh-auth remove chrishunt
46+
$ gh-auth --remove chrishunt
4747
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
4848

49-
$ gh-auth remove zachmargolis
49+
$ gh-auth --list
50+
Added users: zachmargolis
51+
52+
$ gh-auth --remove zachmargolis
5053
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
5154

52-
$ gh-auth list
55+
$ gh-auth --list
5356
Added users:
5457
```
5558

@@ -78,7 +81,13 @@ Added users:
7881
`gh-auth` can be used from the command line after the gem has been installed.
7982

8083
```bash
81-
usage: gh-auth [--version] [add|remove|list] <username>
84+
usage: gh-auth [--version] [--list] [--add|--remove] <username>
85+
86+
options:
87+
--add doug,sally Add GitHub users
88+
--remove doug,sally Remove GitHub users
89+
--list List all GitHub users added
90+
--version Show version
8291
```
8392

8493
### In Your Project
@@ -90,14 +99,10 @@ too.
9099
require 'github/auth'
91100

92101
# Add keys for GitHub user 'chrishunt'
93-
Github::Auth::CLI.new(%w(
94-
add chrishunt
95-
)).execute
102+
Github::Auth::CLI.new.execute %w(add chrishunt)
96103

97104
# Remove keys for GitHub user 'chrishunt'
98-
Github::Auth::CLI.new(%w(
99-
remove chrishunt
100-
)).execute
105+
Github::Auth::CLI.new.execute %w(remove chrishunt)
101106
```
102107

103108
## Installation
@@ -108,7 +113,13 @@ Install the `github-auth` gem:
108113
$ gem install github-auth
109114

110115
$ gh-auth
111-
usage: gh-auth [--version] [add|remove|list] <username>
116+
usage: gh-auth [--version] [--list] [--add|--remove] <username>
117+
118+
options:
119+
--add doug,sally Add GitHub users
120+
--remove doug,sally Remove GitHub users
121+
--list List all GitHub users added
122+
--version Show version
112123
```
113124

114125
### SSH Public Key Authentication (Mac OS X)
@@ -136,7 +147,7 @@ First, authorize yourself for ssh. (Make sure to replace 'chrishunt' with
136147
*your* GitHub username)
137148

138149
```bash
139-
$ gh-auth add chrishunt
150+
$ gh-auth --add chrishunt
140151
Adding 2 key(s) to '/Users/chris/.ssh/authorized_keys'
141152
```
142153

@@ -152,7 +163,7 @@ $ ssh -o PreferredAuthentications=publickey localhost
152163
Next, remove your public keys from the keys file:
153164

154165
```bash
155-
$ gh-auth remove chrishunt
166+
$ gh-auth --remove chrishunt
156167
Removing 2 key(s) from '/Users/chris/.ssh/authorized_keys'
157168
```
158169

0 commit comments

Comments
 (0)