plz 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +17 -0
- data/lib/plz/commands/help.rb +13 -4
- data/lib/plz/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c460aa6b8d8420a207412cd8eb6b4f021fa1ec
|
4
|
+
data.tar.gz: 54758d244a1c9327be1fdbf792b39fcf1e771923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d041b2b035559bdbefeb2ca63a7c40232840e2c9ea2a4859512e5c8509fed86e45aa7af0a0b7153df8dc9ec70b6d4797a71390ce2a56b7e58f4e3855c3dd7d78
|
7
|
+
data.tar.gz: bed7866059fee8e2227e0944e235a6f405d74d931a5648f381883c9b6b0a4a89b72968d282715e26c1074ec56ae2a0a6b83aaba004c2d92fa586dd524ca9785c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -54,6 +54,23 @@ while `key:=value` is parsed into JSON value (e.g. key:=17 will be `{"key":17}`)
|
|
54
54
|
$ plz create user name=alice age:=17
|
55
55
|
```
|
56
56
|
|
57
|
+
### Options
|
58
|
+
Plz takes some command line options.
|
59
|
+
|
60
|
+
```sh
|
61
|
+
$ plz --help
|
62
|
+
Usage: plz <action> <target> [headers|params] [options]
|
63
|
+
-h, --help Display help message
|
64
|
+
--no-color Disable coloring output
|
65
|
+
--no-response-body Hide response body
|
66
|
+
--no-response-header Hide response header
|
67
|
+
Examples:
|
68
|
+
plz list user
|
69
|
+
plz create user
|
70
|
+
plz update user id=1
|
71
|
+
plz delete user id=1
|
72
|
+
```
|
73
|
+
|
57
74
|
### Example
|
58
75
|
```sh
|
59
76
|
# GET /users
|
data/lib/plz/commands/help.rb
CHANGED
@@ -18,11 +18,20 @@ module Plz
|
|
18
18
|
# @return [Array<String>]
|
19
19
|
def links
|
20
20
|
@schema.properties.map do |target_name, schema|
|
21
|
-
schema.links.
|
22
|
-
|
23
|
-
|
21
|
+
schema.links.select do |link|
|
22
|
+
link.href && link.method && link.title
|
23
|
+
end.map do |link|
|
24
|
+
str = " plz #{link.title.underscore} #{target_name.underscore}"
|
25
|
+
if key = link.href[/{(.+)}/, 1]
|
26
|
+
name = key.gsub(/[()]/, "").split("/").last
|
27
|
+
if property = link.parent.properties[name]
|
28
|
+
if example = property.data["example"]
|
29
|
+
str << " #{name}=#{example.inspect}"
|
30
|
+
end
|
31
|
+
end
|
24
32
|
end
|
25
|
-
|
33
|
+
str
|
34
|
+
end
|
26
35
|
end.flatten
|
27
36
|
end
|
28
37
|
end
|
data/lib/plz/version.rb
CHANGED