github_cli 0.4.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/.travis.yml +0 -2
- data/CHANGELOG.md +14 -0
- data/Gemfile.lock +9 -3
- data/README.md +68 -48
- data/Rakefile +47 -1
- data/bin/gcli +18 -0
- data/bin/ghc +1 -17
- data/features/blob.feature +6 -6
- data/features/collaborator.feature +10 -10
- data/features/commit.feature +6 -6
- data/features/completion.feature +3 -3
- data/features/config.feature +55 -0
- data/features/content.feature +9 -9
- data/features/download.feature +11 -11
- data/features/email.feature +8 -8
- data/features/errors.feature +11 -9
- data/features/event.feature +20 -20
- data/features/executable.feature +4 -4
- data/features/follower.feature +13 -13
- data/features/fork.feature +6 -6
- data/features/gist.feature +22 -22
- data/features/hook.feature +14 -14
- data/features/init.feature +48 -0
- data/features/issue.feature +12 -12
- data/features/key.feature +12 -12
- data/features/label.feature +23 -23
- data/features/member.feature +13 -13
- data/features/milestone.feature +12 -12
- data/features/organization.feature +9 -9
- data/features/pull_request.feature +18 -18
- data/features/reference.feature +13 -13
- data/features/repository.feature +20 -20
- data/features/search.feature +10 -10
- data/features/search_commands.feature +4 -4
- data/features/support/hooks.rb +3 -1
- data/features/tag.feature +6 -6
- data/features/team.feature +28 -28
- data/features/tree.feature +5 -5
- data/features/usage.feature +3 -3
- data/features/user.feature +7 -7
- data/features/watching.feature +13 -13
- data/fixtures/simple_config +9 -8
- data/github_cli.gemspec +2 -2
- data/lib/github_cli/api.rb +3 -3
- data/lib/github_cli/cli.rb +96 -17
- data/lib/github_cli/config.rb +30 -9
- data/lib/github_cli/editor.rb +11 -6
- data/lib/github_cli/man/gcli-config.1 +102 -0
- data/lib/github_cli/man/gcli-config.1.txt +96 -0
- data/lib/github_cli/man/gcli-repo.1 +16 -0
- data/lib/github_cli/man/gcli-repo.1.txt +15 -0
- data/lib/github_cli/man/gcli.1 +34 -0
- data/lib/github_cli/man/gcli.1.txt +33 -0
- data/lib/github_cli/manpage.rb +42 -0
- data/lib/github_cli/pager.rb +1 -1
- data/lib/github_cli/terminal.rb +8 -2
- data/lib/github_cli/thor_ext.rb +12 -1
- data/lib/github_cli/vendor.rb +10 -0
- data/lib/github_cli/version.rb +1 -1
- data/lib/github_cli.rb +7 -2
- data/man/gcli-config.1.ronn +82 -0
- data/man/gcli-repo.1.ronn +7 -0
- data/man/gcli.1.ronn +29 -0
- data/spec/github_cli/config_spec.rb +21 -7
- metadata +43 -22
- data/features/settings.feature +0 -35
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
0.5.0 (August 17, 2012) - IMPORTANT!!!
|
2
|
+
|
3
|
+
* Change editor settings to seek first local config before system properties.
|
4
|
+
* Change config key format and add config file location setup.
|
5
|
+
* Change init command to allow for local and global config files.
|
6
|
+
* Add new default configuration options to .githubrc file.
|
7
|
+
* Fix bug with setting config file options.
|
8
|
+
* Add pretty printing of config entries with pattern matching.
|
9
|
+
* Add config command for setting, unsetting and listing of options with tests.
|
10
|
+
* Change executable command name from *ghc* to *gcli*
|
11
|
+
* Add manpages for gcli executable and config command.
|
12
|
+
* Setup automatic manpage trigger on help command.
|
13
|
+
* Add raketask for vendoring gems and vendor thor.
|
14
|
+
|
1
15
|
0.4.4 (July 15, 2012)
|
2
16
|
|
3
17
|
* Fix bug with tree retrieval and add feature tests.
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
github_cli (0.
|
4
|
+
github_cli (0.5.0)
|
5
5
|
github_api (~> 0.6)
|
6
|
-
thor
|
7
6
|
|
8
7
|
GEM
|
9
8
|
remote: https://rubygems.org/
|
@@ -37,10 +36,12 @@ GEM
|
|
37
36
|
nokogiri (~> 1.5.2)
|
38
37
|
oauth2
|
39
38
|
hashie (1.2.0)
|
39
|
+
hpricot (0.8.6)
|
40
40
|
httpauth (0.1)
|
41
41
|
json (1.7.3)
|
42
42
|
multi_json (1.3.6)
|
43
43
|
multipart-post (1.1.5)
|
44
|
+
mustache (0.99.4)
|
44
45
|
nokogiri (1.5.3)
|
45
46
|
oauth2 (0.7.1)
|
46
47
|
faraday (~> 0.8)
|
@@ -51,6 +52,11 @@ GEM
|
|
51
52
|
rack-protection (1.2.0)
|
52
53
|
rack
|
53
54
|
rake (0.9.2.2)
|
55
|
+
rdiscount (1.6.8)
|
56
|
+
ronn (0.7.3)
|
57
|
+
hpricot (>= 0.8.2)
|
58
|
+
mustache (>= 0.7.0)
|
59
|
+
rdiscount (>= 1.5.8)
|
54
60
|
rspec (2.10.0)
|
55
61
|
rspec-core (~> 2.10.0)
|
56
62
|
rspec-expectations (~> 2.10.0)
|
@@ -63,7 +69,6 @@ GEM
|
|
63
69
|
rack (~> 1.3, >= 1.3.6)
|
64
70
|
rack-protection (~> 1.2)
|
65
71
|
tilt (~> 1.3, >= 1.3.3)
|
66
|
-
thor (0.15.2)
|
67
72
|
tilt (1.3.3)
|
68
73
|
|
69
74
|
PLATFORMS
|
@@ -74,4 +79,5 @@ DEPENDENCIES
|
|
74
79
|
communist
|
75
80
|
github_cli!
|
76
81
|
rake
|
82
|
+
ronn
|
77
83
|
rspec
|
data/README.md
CHANGED
@@ -26,41 +26,61 @@ Or install it yourself as:
|
|
26
26
|
Run it:
|
27
27
|
|
28
28
|
```shell
|
29
|
-
$
|
29
|
+
$ gcli
|
30
30
|
```
|
31
31
|
|
32
32
|
### Initialize a configuration file
|
33
33
|
|
34
|
-
The first step is to create a configuration file:
|
34
|
+
The first step is to create a configuration file, either global in home directory or local inside the project:
|
35
35
|
|
36
36
|
```shell
|
37
|
-
$
|
37
|
+
$ gcli init [--global|--local]
|
38
38
|
```
|
39
39
|
|
40
|
-
This will setup a `.githubrc` configuration file in your home directory
|
41
|
-
all the global settings. During the install process you will be prompted
|
42
|
-
`authentication token`.
|
40
|
+
This will setup a `.githubrc` configuration file in your home/project directory
|
41
|
+
with all the global settings. During the install process you will be prompted
|
42
|
+
for your `authentication token`.
|
43
|
+
|
44
|
+
Moreover, `gcli config` command allows you to set/get any configuration option such as output format, editor or oauth token.
|
45
|
+
|
46
|
+
For instance, to check value for your `token` do
|
47
|
+
|
48
|
+
```shell
|
49
|
+
$ gcli config [--global|--local] auth.token
|
50
|
+
```
|
51
|
+
|
52
|
+
and to set the value do
|
53
|
+
|
54
|
+
```shell
|
55
|
+
$ gcli config [--global|--local] auth.token lh23l4kj234....
|
56
|
+
```
|
57
|
+
|
58
|
+
To list specific options
|
59
|
+
|
60
|
+
```shell
|
61
|
+
$ gcli config [--global|--local] --list [regex]
|
62
|
+
```
|
43
63
|
|
44
64
|
### Arguments
|
45
65
|
|
46
|
-
The required arguments come first as per command description, then
|
66
|
+
The required arguments come first as per command description, then are followed by the optional arguments supplied inside a `params` flag.
|
47
67
|
|
48
|
-
|
68
|
+
For instance, one can create repository by supplying parameters in the following way:
|
49
69
|
|
50
70
|
```shell
|
51
|
-
|
71
|
+
$ gcli repo create octokit --params=description:'Test repo for kitty.'
|
52
72
|
```
|
53
73
|
|
54
74
|
To create repository inside organization:
|
55
75
|
|
56
76
|
```shell
|
57
|
-
|
77
|
+
$ gcli repo create github/octokit --params=description:'Test repo for kitty.'
|
58
78
|
```
|
59
79
|
|
60
|
-
To find out which options are required and optional type:
|
80
|
+
To find out which options are required and which are optional - type:
|
61
81
|
|
62
82
|
```shell
|
63
|
-
|
83
|
+
$ gcli repo help create
|
64
84
|
```
|
65
85
|
|
66
86
|
### Getting a list of commands
|
@@ -68,13 +88,13 @@ ghc repo help create
|
|
68
88
|
You can list all GitHub APIs comamnds:
|
69
89
|
|
70
90
|
```shell
|
71
|
-
$
|
91
|
+
$ gcli list
|
72
92
|
```
|
73
93
|
|
74
94
|
to limit returned results pass `pattern`
|
75
95
|
|
76
96
|
```shell
|
77
|
-
$
|
97
|
+
$ gcli list re* # Returns all commands matching the pattern
|
78
98
|
```
|
79
99
|
|
80
100
|
### Output Format
|
@@ -84,19 +104,19 @@ The API responses can be formatted as `csv`, `json`, `pretty`, `table`.
|
|
84
104
|
By default responses are in tabular format. Tables are available in `horizontal` and `vertical` mode. To enforce table display pass `:h` and `:v` respectively. Otherwise a default orientation will be picked depending on the request made and terminal size.
|
85
105
|
|
86
106
|
```shell
|
87
|
-
|
107
|
+
gcli user get -u peter-murach --format=table:h
|
88
108
|
|
89
|
-
|
90
|
-
┃ type ┃ login ┃ public_… ┃ blog ┃ hireable ┃ followe… ┃ followi… ┃ location ┃ html_url ┃
|
91
|
-
|
92
|
-
┃ User ┃ peter-m… ┃ 14 ┃ peter-m… ┃ false ┃ 18 ┃ 52 ┃ Sheffie… ┃ https:/… ┃
|
93
|
-
|
109
|
+
┏━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳
|
110
|
+
┃ type ┃ login ┃ public_… ┃ blog ┃ hireable ┃ followe… ┃ followi… ┃ location ┃ html_url ┃
|
111
|
+
┣━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━╋━━━━━━━━━━╋
|
112
|
+
┃ User ┃ peter-m… ┃ 14 ┃ peter-m… ┃ false ┃ 18 ┃ 52 ┃ Sheffie… ┃ https:/… ┃
|
113
|
+
┗━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━━━━┻━━━━━━━━━━┻
|
94
114
|
```
|
95
115
|
|
96
116
|
To get `csv` formatting for easy command piping do
|
97
117
|
|
98
118
|
```shell
|
99
|
-
|
119
|
+
gcli repo ls -u wycats --format=csv
|
100
120
|
```
|
101
121
|
|
102
122
|
### Output Paging
|
@@ -104,7 +124,7 @@ ghc repo ls -u wycats --format=csv
|
|
104
124
|
By default all responses are paged. You can switch off paging by supplying `no-pager` flag.
|
105
125
|
|
106
126
|
```shell
|
107
|
-
|
127
|
+
gcli --no-pager user ls -u wycats
|
108
128
|
```
|
109
129
|
|
110
130
|
Also you can supply you preferred `pager`, otherwise the paging program is taken from environment variable PAGER if defined or defaults to "less".
|
@@ -114,67 +134,67 @@ Also you can supply you preferred `pager`, otherwise the paging program is taken
|
|
114
134
|
Interact with git data:
|
115
135
|
|
116
136
|
```shell
|
117
|
-
$
|
118
|
-
$
|
119
|
-
$
|
120
|
-
$
|
121
|
-
$
|
137
|
+
$ gcli blob
|
138
|
+
$ gcli commit
|
139
|
+
$ gcli ref
|
140
|
+
$ gcli tag
|
141
|
+
$ gcli tree
|
122
142
|
```
|
123
143
|
|
124
144
|
Interact with issues:
|
125
145
|
|
126
146
|
```shell
|
127
|
-
$
|
128
|
-
$
|
129
|
-
$
|
130
|
-
$
|
147
|
+
$ gcli issue
|
148
|
+
$ gcli label
|
149
|
+
$ gcli milestone
|
150
|
+
$ gcli comment
|
131
151
|
```
|
132
152
|
|
133
153
|
Interact with repositories:
|
134
154
|
|
135
155
|
```shell
|
136
|
-
$
|
137
|
-
$
|
138
|
-
$
|
139
|
-
$
|
140
|
-
$
|
141
|
-
$
|
142
|
-
$
|
143
|
-
$
|
156
|
+
$ gcli repo
|
157
|
+
$ gcli collab
|
158
|
+
$ gcli content
|
159
|
+
$ gcli download
|
160
|
+
$ gcli fork
|
161
|
+
$ gcli hook
|
162
|
+
$ gcli key
|
163
|
+
$ gcli watching
|
144
164
|
```
|
145
165
|
|
146
166
|
Interact with gists:
|
147
167
|
|
148
168
|
```shell
|
149
|
-
$
|
169
|
+
$ gcli gist
|
150
170
|
```
|
151
171
|
|
152
172
|
Interact with users:
|
153
173
|
|
154
174
|
```shell
|
155
|
-
$
|
156
|
-
$
|
157
|
-
$
|
175
|
+
$ gcli user
|
176
|
+
$ gcli email
|
177
|
+
$ gcli follower
|
158
178
|
```
|
159
179
|
|
160
180
|
Interact with organizations:
|
161
181
|
|
162
182
|
```shell
|
163
|
-
$
|
164
|
-
$
|
165
|
-
$
|
183
|
+
$ gcli org
|
184
|
+
$ gcli member
|
185
|
+
$ gcli team
|
166
186
|
```
|
167
187
|
|
168
188
|
Interact with authorizations:
|
169
189
|
|
170
190
|
```shell
|
171
|
-
$
|
191
|
+
$ gcli auth
|
172
192
|
```
|
173
193
|
|
174
194
|
Interact with search:
|
175
195
|
|
176
196
|
```shell
|
177
|
-
$
|
197
|
+
$ gcli search
|
178
198
|
```
|
179
199
|
|
180
200
|
## Contributing
|
data/Rakefile
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.unshift File.expand_path('../lib', __FILE__)
|
2
3
|
require "bundler/gem_tasks"
|
3
4
|
require "rspec/core/rake_task"
|
4
5
|
require "cucumber/rake/task"
|
@@ -10,3 +11,48 @@ end
|
|
10
11
|
Cucumber::Rake::Task.new(:features)
|
11
12
|
|
12
13
|
task :default => [:spec, :features]
|
14
|
+
|
15
|
+
task :release => ["man:clean", "man:build"]
|
16
|
+
|
17
|
+
begin
|
18
|
+
require 'ronn'
|
19
|
+
|
20
|
+
namespace :man do
|
21
|
+
|
22
|
+
directory "lib/github_cli/man"
|
23
|
+
|
24
|
+
FileList["man/*.ronn"].each do |ronn|
|
25
|
+
basename = File.basename(ronn, ".ronn")
|
26
|
+
roff = "lib/github_cli/man/#{basename}"
|
27
|
+
|
28
|
+
file roff => ["lib/github_cli/man", ronn] do
|
29
|
+
sh "#{Gem.ruby} -S ronn --roff --pipe #{ronn} > #{roff}"
|
30
|
+
end
|
31
|
+
|
32
|
+
file "#{roff}.txt" => roff do
|
33
|
+
sh "groff -Wall -mtty-char -mandoc -Tascii #{roff} | col -b > #{roff}.txt"
|
34
|
+
end
|
35
|
+
|
36
|
+
task :build_all_pages => "#{roff}.txt"
|
37
|
+
end
|
38
|
+
|
39
|
+
desc "Build the man pages"
|
40
|
+
task :build => "man:build_all_pages"
|
41
|
+
|
42
|
+
desc 'Clean up the buit man pages'
|
43
|
+
task :clean do
|
44
|
+
rm_rf "lib/github_cli/man"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
namespace :vendor do
|
50
|
+
desc "Build"
|
51
|
+
task :build => :clean do
|
52
|
+
sh "git clone git://github.com/wycats/thor.git lib/github_cli/vendor/thor"
|
53
|
+
end
|
54
|
+
|
55
|
+
task :clean do
|
56
|
+
rm_rf "lib/github_cli/vendor"
|
57
|
+
end
|
58
|
+
end
|
data/bin/gcli
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
lib_dir = File.expand_path("../../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift lib_dir if File.directory?(lib_dir)
|
4
|
+
|
5
|
+
require "github_cli"
|
6
|
+
begin
|
7
|
+
GithubCLI::CLI.start
|
8
|
+
rescue Interrupt => e
|
9
|
+
GithubCLI.ui.error "\nQuitting..."
|
10
|
+
GithubCLI.ui.debug e.backtrace.join("\n")
|
11
|
+
exit 1
|
12
|
+
rescue SystemExit => e
|
13
|
+
exit e.status
|
14
|
+
rescue Exception => e
|
15
|
+
GithubCLI.ui.error "Fatal error has occurred. " + e.message.to_s
|
16
|
+
GithubCLI.ui.debug e.backtrace.join("\n")
|
17
|
+
exit 1
|
18
|
+
end
|
data/bin/ghc
CHANGED
@@ -1,18 +1,2 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift lib_dir if File.directory?(lib_dir)
|
4
|
-
|
5
|
-
require "github_cli"
|
6
|
-
begin
|
7
|
-
GithubCLI::CLI.start
|
8
|
-
rescue Interrupt => e
|
9
|
-
GithubCLI.ui.error "\nQuitting..."
|
10
|
-
GithubCLI.ui.debug e.backtrace.join("\n")
|
11
|
-
exit 1
|
12
|
-
rescue SystemExit => e
|
13
|
-
exit e.status
|
14
|
-
rescue Exception => e
|
15
|
-
GithubCLI.ui.error "Fatal error has occurred. " + e.message
|
16
|
-
GithubCLI.ui.debug e.backtrace.join("\n")
|
17
|
-
exit 1
|
18
|
-
end
|
2
|
+
$stdout.print "[DEPRECATED] Please use `gcli` instead."
|
data/features/blob.feature
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli blob
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli blob`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli blob get"
|
8
|
+
And the output should contain "gcli blob create"
|
9
9
|
|
10
10
|
Scenario: Get blob
|
11
11
|
Given the GitHub API server:
|
12
12
|
"""
|
13
13
|
get('/repos/wycats/thor/git/blobs/59b23de9b91d') { status 200 }
|
14
14
|
"""
|
15
|
-
When I run `
|
15
|
+
When I run `gcli blob get wycats thor 59b23de9b91d`
|
16
16
|
Then the exit status should be 0
|
17
17
|
|
18
18
|
Scenario: Create blob
|
@@ -20,5 +20,5 @@ Feature: ghc blob
|
|
20
20
|
"""
|
21
21
|
post('/repos/wycats/thor/git/blobs') { status 200 }
|
22
22
|
"""
|
23
|
-
When I run `
|
23
|
+
When I run `gcli blob create wycats thor --params=content:'Content' encoding:'utf-8'`
|
24
24
|
Then the exit status should be 0
|
@@ -1,20 +1,20 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli collab
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli collab`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
10
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli collab list"
|
8
|
+
And the output should contain "gcli collab add"
|
9
|
+
And the output should contain "gcli collab collab"
|
10
|
+
And the output should contain "gcli collab remove"
|
11
11
|
|
12
12
|
Scenario: List collaborators
|
13
13
|
Given the GitHub API server:
|
14
14
|
"""
|
15
15
|
get('/repos/wycats/thor/collaborators') { status 200 }
|
16
16
|
"""
|
17
|
-
When I run `
|
17
|
+
When I run `gcli collab ls wycats thor`
|
18
18
|
Then the exit status should be 0
|
19
19
|
|
20
20
|
Scenario: Add collaborator
|
@@ -22,7 +22,7 @@ Feature: ghc collab
|
|
22
22
|
"""
|
23
23
|
put('/repos/wycats/thor/collaborators/octocat') { status 200 }
|
24
24
|
"""
|
25
|
-
When I run `
|
25
|
+
When I run `gcli collab add wycats thor octocat`
|
26
26
|
Then the exit status should be 0
|
27
27
|
|
28
28
|
Scenario: Remove collaborator
|
@@ -30,7 +30,7 @@ Feature: ghc collab
|
|
30
30
|
"""
|
31
31
|
delete('/repos/wycats/thor/collaborators/octocat') { status 200 }
|
32
32
|
"""
|
33
|
-
When I run `
|
33
|
+
When I run `gcli collab remove wycats thor octocat`
|
34
34
|
Then the exit status should be 0
|
35
35
|
|
36
36
|
Scenario: Check if collaborator
|
@@ -38,6 +38,6 @@ Feature: ghc collab
|
|
38
38
|
"""
|
39
39
|
delete('/repos/wycats/thor/collaborators/octocat') { status 200 }
|
40
40
|
"""
|
41
|
-
When I run `
|
41
|
+
When I run `gcli collab collab wycats thor octocat`
|
42
42
|
Then the exit status should be 0
|
43
43
|
|
data/features/commit.feature
CHANGED
@@ -1,18 +1,18 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli commit
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli commit`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli commit get"
|
8
|
+
And the output should contain "gcli commit create"
|
9
9
|
|
10
10
|
Scenario: Get commit
|
11
11
|
Given the GitHub API server:
|
12
12
|
"""
|
13
13
|
get('/repos/wycats/thor/git/commits/59b23de9b91d') { status 200 }
|
14
14
|
"""
|
15
|
-
When I run `
|
15
|
+
When I run `gcli commit get wycats thor 59b23de9b91d`
|
16
16
|
Then the exit status should be 0
|
17
17
|
|
18
18
|
Scenario: Create commit
|
@@ -20,5 +20,5 @@ Feature: ghc commit
|
|
20
20
|
"""
|
21
21
|
post('/repos/wycats/thor/git/commits') { status 200 }
|
22
22
|
"""
|
23
|
-
When I run `
|
23
|
+
When I run `gcli commit create wycats thor --params=message:'my commit' tree:827efc parents:['7d1b31e']`
|
24
24
|
Then the exit status should be 0
|
data/features/completion.feature
CHANGED
@@ -2,7 +2,7 @@ Feature: Command Completion
|
|
2
2
|
|
3
3
|
Scenario: Suggest alternative
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli blah`
|
6
6
|
Then the exit status should be 0
|
7
7
|
And the output should contain:
|
8
8
|
"""
|
@@ -12,7 +12,7 @@ Feature: Command Completion
|
|
12
12
|
|
13
13
|
Scenario: Suggest more than one
|
14
14
|
|
15
|
-
When I run `
|
15
|
+
When I run `gcli convent`
|
16
16
|
Then the exit status should be 0
|
17
17
|
And the output should contain:
|
18
18
|
"""
|
@@ -24,7 +24,7 @@ Feature: Command Completion
|
|
24
24
|
|
25
25
|
Scenario: Suggset nothing
|
26
26
|
|
27
|
-
When I run `
|
27
|
+
When I run `gcli xen`
|
28
28
|
Then the exit status should be 0
|
29
29
|
And the output should not contain:
|
30
30
|
"""
|
@@ -0,0 +1,55 @@
|
|
1
|
+
Feature: Configuration file
|
2
|
+
|
3
|
+
Scenario: Config requires scope
|
4
|
+
When I run `gcli config`
|
5
|
+
Then the output should contain:
|
6
|
+
"""
|
7
|
+
Invalid scope given. Please use --local or --global.
|
8
|
+
"""
|
9
|
+
|
10
|
+
Scenario: Missing global file
|
11
|
+
When I run `gcli config --global`
|
12
|
+
Then the output should contain:
|
13
|
+
"""
|
14
|
+
global configuration file does not exist. Please use `gcli init --global`
|
15
|
+
"""
|
16
|
+
|
17
|
+
Scenario: Missing local file
|
18
|
+
When I run `gcli config --local`
|
19
|
+
Then the output should contain:
|
20
|
+
"""
|
21
|
+
local configuration file does not exist. Please use `gcli init --local`
|
22
|
+
"""
|
23
|
+
|
24
|
+
Scenario: List global file options
|
25
|
+
Given I run `gcli init --global` interactively
|
26
|
+
And I type "token"
|
27
|
+
When I run `gcli config --global`
|
28
|
+
Then the output should contain:
|
29
|
+
"""
|
30
|
+
Configuration options:
|
31
|
+
"""
|
32
|
+
|
33
|
+
Scenario: Read existing option
|
34
|
+
Given I run `gcli init --global` interactively
|
35
|
+
And I type "abc123"
|
36
|
+
When I successfully run `gcli config --global auth.token`
|
37
|
+
Then the stdout should contain "abc123"
|
38
|
+
|
39
|
+
Scenario: Read missing option
|
40
|
+
Given I run `gcli init --global` interactively
|
41
|
+
And I type "abc123"
|
42
|
+
When I run `gcli config --global missing.key`
|
43
|
+
Then the exit status should be 0
|
44
|
+
|
45
|
+
Scenario: Write existing option
|
46
|
+
Given I run `gcli init --global` interactively
|
47
|
+
And I type "abc123"
|
48
|
+
When I successfully run `gcli config --global auth.token eee555`
|
49
|
+
Then the stdout should contain "eee555"
|
50
|
+
|
51
|
+
Scenario: Write missing option
|
52
|
+
Given I run `gcli init --global` interactively
|
53
|
+
And I type "abc123"
|
54
|
+
When I successfully run `gcli config --global core.token eee555`
|
55
|
+
Then the stdout should contain "eee555"
|
data/features/content.feature
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: gcli content
|
2
2
|
|
3
3
|
Scenario: Available commands
|
4
4
|
|
5
|
-
When I run `
|
5
|
+
When I run `gcli content`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And the output should contain "
|
8
|
-
And the output should contain "
|
9
|
-
And the output should contain "
|
7
|
+
And the output should contain "gcli content get"
|
8
|
+
And the output should contain "gcli content readme"
|
9
|
+
And the output should contain "gcli content archive"
|
10
10
|
|
11
11
|
Scenario: Readme
|
12
12
|
Given the GitHub API server:
|
13
13
|
"""
|
14
14
|
get('/repos/wycats/thor/readme') { status 200 }
|
15
15
|
"""
|
16
|
-
When I run `
|
16
|
+
When I run `gcli content readme wycats thor`
|
17
17
|
Then the exit status should be 0
|
18
18
|
|
19
19
|
Scenario: Get content
|
@@ -21,7 +21,7 @@ Feature: ghc content
|
|
21
21
|
"""
|
22
22
|
get('/repos/wycats/thor/contents/lib') { status 200 }
|
23
23
|
"""
|
24
|
-
When I run `
|
24
|
+
When I run `gcli content get wycats thor lib`
|
25
25
|
Then the exit status should be 0
|
26
26
|
|
27
27
|
Scenario: Archive
|
@@ -29,7 +29,7 @@ Feature: ghc content
|
|
29
29
|
"""
|
30
30
|
get('/repos/wycats/thor/zipball/master') { status 200 }
|
31
31
|
"""
|
32
|
-
When I run `
|
32
|
+
When I run `gcli content archive wycats thor`
|
33
33
|
Then the exit status should be 0
|
34
34
|
|
35
35
|
Scenario: Archive with params
|
@@ -37,5 +37,5 @@ Feature: ghc content
|
|
37
37
|
"""
|
38
38
|
get('/repos/wycats/thor/tarball/new_feature') { status 200 }
|
39
39
|
"""
|
40
|
-
When I run `
|
40
|
+
When I run `gcli content archive wycats thor --params=archive_format:tarball ref:new_feature`
|
41
41
|
Then the exit status should be 0
|