Skip to content

Commit acd64d6

Browse files
committed
v0.3.2
Add domain helpers for "beta" and "test" see README for details.
1 parent 949886c commit acd64d6

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

canvas/README

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,24 @@ OPTIONS
4545
This option allows querying a specified domain,
4646
overriding the value set in the .inst config file.
4747

48+
Helpers are provided for "beta" and "test", reserving
49+
these for use with the domain provided in the .inst
50+
config file. Using either of these reserved words
51+
will not require the -t option to be included as
52+
described below. E.g. the config file has the a stored
53+
token and a value for canvas_domain of "foobar", in
54+
order to connect to https://foobar.beta.instructure.com
55+
simply use "-d beta"
56+
4857
The value only requires the subdomain string of
4958
instructure.com. E.g. if the desired domain to query
5059
is https://foobar.instructure.com then pass the option
5160
"-d foobar"
5261

5362
-d also requires that -t <token> be included
54-
in the query. canvas will not allow you to pass one
55-
authentication parameter and read the others from config.
63+
in the query unless the value of -d is "beta or "test".
64+
canvas will not allow you to pass one authentication
65+
parameter and read the others from config.
5666

5767
-F <name=content>
5868
The Form option transparently passes to curl. Please read

canvas/canvas

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@ verbosehelp() {
161161
}
162162

163163
usage() {
164-
echo -e 2>&1 "Usage: canvas [options] method\r\nHelp: canvas -h"
164+
echo -e 2>&1 "Usage: canvas [options] method\r\nHelp: canvas -h"
165165
}
166166

167167
version() {
168168
logo
169-
echo >&2 " canvas-cli version 0.3.1"
169+
echo >&2 " canvas-cli version 0.3.2"
170170
exit
171171
}
172172

@@ -424,6 +424,10 @@ fi
424424

425425
if [ -z "$canvas_domain" ] && [ -z "$canvas_token" ]; then
426426
readconfig
427+
elif [ $canvas_domain = "beta" ] || [ $canvas_domain = "test" ]; then
428+
sd=$canvas_domain
429+
readconfig
430+
canvas_domain="$canvas_domain.$sd"
427431
elif [ -z "$canvas_domain" ] || [ -z "$canvas_token" ]; then
428432
echo >&2 "Both \`-d\` and \`-t\` are requied when not using a config file"
429433
usage

0 commit comments

Comments
 (0)