commit 0a45179852c4c74a35f8503259ca280eb0bfed3e
parent 2f41c0f24f366aff3b752105660c74cabe467fc4
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Thu, 12 Mar 2020 23:54:37 +0100
ghp: some help stuff
Former-commit-id: 9307a26e39e99c409d13ccdc5ac41f0a38463e3a
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/scripts/ghp b/scripts/ghp
@@ -82,9 +82,18 @@ elsif ["watch", "w", "status", "s"].include? subcmd
else
puts "Provide the name of one or more repositories."
end
-elsif ["rate", "remaining"].include? subcmd
+elsif ["rate", "remaining", "r"].include? subcmd
response = Faraday.get("https://api.github.com/rate_limit", nil, authorization: "token #{ENV['GITHUB_AUTH_TOKEN']}")
j = JSON.parse(response.body)
core = j['resources']['core']
puts "Requests remaining: #{core['remaining']}/#{core['limit']}"
+else
+ puts <<-YEET
+ Available commands:
+
+ watch, w, status, s print out the status of pages
+ build, b trigger a build of a page
+ rate, remaining, r print out the number of remaining API requests
+ YEET
+
end