laws 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/laws +18 -18
- metadata +2 -2
data/bin/laws
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'cri'
|
3
|
-
require '
|
3
|
+
require 'laws/aws_utils'
|
4
4
|
|
5
5
|
include AWSAccess
|
6
6
|
|
@@ -21,12 +21,12 @@ def configure_user(opts)
|
|
21
21
|
if aws_id || aws_key
|
22
22
|
unless aws_id
|
23
23
|
puts 'Please provide an id with your key.'
|
24
|
-
puts 'Try
|
24
|
+
puts 'Try laws -h for more information.'
|
25
25
|
exit 1
|
26
26
|
end
|
27
27
|
unless aws_key
|
28
28
|
puts 'Please provide a key with your id.'
|
29
|
-
puts 'Try
|
29
|
+
puts 'Try laws -h for more information.'
|
30
30
|
exit 1
|
31
31
|
end
|
32
32
|
configure_aws(aws_id, aws_key)
|
@@ -69,12 +69,12 @@ s3_create_cmd = Cri::Command.define do
|
|
69
69
|
bucket_name = args.shift
|
70
70
|
unless bucket_name
|
71
71
|
puts "create requires a bucket name."
|
72
|
-
puts "try
|
72
|
+
puts "try laws s3 create -h for more information"
|
73
73
|
exit 1
|
74
74
|
end
|
75
75
|
unless args.empty?
|
76
76
|
puts "too many arguments to create."
|
77
|
-
puts "try
|
77
|
+
puts "try laws s3 create -h for more information"
|
78
78
|
exit 1
|
79
79
|
end
|
80
80
|
configure_user(opts)
|
@@ -93,12 +93,12 @@ s3_list_cmd = Cri::Command.define do
|
|
93
93
|
bucket_name = args.shift
|
94
94
|
unless bucket_name
|
95
95
|
puts 'list requires a bucket name.'
|
96
|
-
puts 'Try
|
96
|
+
puts 'Try laws s3 list -h for more information'
|
97
97
|
exit 1
|
98
98
|
end
|
99
99
|
unless args.empty?
|
100
100
|
puts "too many arguments to list."
|
101
|
-
puts "try
|
101
|
+
puts "try laws s3 list -h for more information"
|
102
102
|
exit 1
|
103
103
|
end
|
104
104
|
configure_user(opts)
|
@@ -116,7 +116,7 @@ s3_buckets_cmd = Cri::Command.define do
|
|
116
116
|
run do |opts, args, cmd|
|
117
117
|
unless args.empty?
|
118
118
|
puts "too many arguments to buckets."
|
119
|
-
puts "try
|
119
|
+
puts "try laws s3 buckets -h for more information"
|
120
120
|
exit 1
|
121
121
|
end
|
122
122
|
configure_user(opts)
|
@@ -140,7 +140,7 @@ s3_exists_cmd = Cri::Command.define do
|
|
140
140
|
end
|
141
141
|
unless args.empty?
|
142
142
|
puts "too many arguments to exists."
|
143
|
-
puts "try
|
143
|
+
puts "try laws s3 exists -h for more information"
|
144
144
|
exit 1
|
145
145
|
end
|
146
146
|
configure_user(opts)
|
@@ -172,7 +172,7 @@ s3_upload_cmd = Cri::Command.define do
|
|
172
172
|
end
|
173
173
|
unless args.empty?
|
174
174
|
puts "too many arguments to upload."
|
175
|
-
puts "try
|
175
|
+
puts "try laws s3 upload -h for more information"
|
176
176
|
exit 1
|
177
177
|
end
|
178
178
|
configure_user(opts)
|
@@ -203,7 +203,7 @@ s3_download_cmd = Cri::Command.define do
|
|
203
203
|
end
|
204
204
|
unless args.empty?
|
205
205
|
puts "too many arguments to download."
|
206
|
-
puts "try
|
206
|
+
puts "try laws s3 download -h for more information"
|
207
207
|
exit 1
|
208
208
|
end
|
209
209
|
configure_user(opts)
|
@@ -227,7 +227,7 @@ s3_delete_cmd = Cri::Command.define do
|
|
227
227
|
end
|
228
228
|
unless args.empty?
|
229
229
|
puts "too many arguments to delete."
|
230
|
-
puts "try
|
230
|
+
puts "try laws s3 delete -h for more information"
|
231
231
|
exit 1
|
232
232
|
end
|
233
233
|
configure_user(opts)
|
@@ -254,7 +254,7 @@ sdb_domains_cmd = Cri::Command.define do
|
|
254
254
|
run do |opts, args, cmd|
|
255
255
|
unless args.empty?
|
256
256
|
puts "too many arguments to domains."
|
257
|
-
puts "try
|
257
|
+
puts "try laws sdb domains -h for more information"
|
258
258
|
exit 1
|
259
259
|
end
|
260
260
|
configure_user(opts)
|
@@ -284,7 +284,7 @@ sdb_select_cmd = Cri::Command.define do
|
|
284
284
|
end
|
285
285
|
unless args.empty?
|
286
286
|
puts "too many arguments to select."
|
287
|
-
puts "try
|
287
|
+
puts "try laws sdb select -h for more information"
|
288
288
|
exit 1
|
289
289
|
end
|
290
290
|
configure_user(opts)
|
@@ -329,7 +329,7 @@ sdb_insert_cmd = Cri::Command.define do
|
|
329
329
|
end
|
330
330
|
unless args.empty?
|
331
331
|
puts "too many arguments to insert."
|
332
|
-
puts "try
|
332
|
+
puts "try laws sdb insert -h for more information"
|
333
333
|
exit 1
|
334
334
|
end
|
335
335
|
configure_user(opts)
|
@@ -353,7 +353,7 @@ sdb_delete_cmd = Cri::Command.define do
|
|
353
353
|
end
|
354
354
|
unless args.empty?
|
355
355
|
puts "too many arguments to delete."
|
356
|
-
puts "try
|
356
|
+
puts "try laws sdb delete -h for more information"
|
357
357
|
exit 1
|
358
358
|
end
|
359
359
|
configure_user(opts)
|
@@ -363,8 +363,8 @@ end
|
|
363
363
|
sdb_cmd.add_command sdb_delete_cmd
|
364
364
|
|
365
365
|
run_cmd = Cri::Command.define do
|
366
|
-
name '
|
367
|
-
usage '
|
366
|
+
name 'laws'
|
367
|
+
usage 'laws <command>'
|
368
368
|
summary 'A CLI tool for interacting with Amazon Web Services'
|
369
369
|
description 'Support command-line interaction with both S3 and SimpleDB.'
|
370
370
|
|