Closed k-walter closed 1 year ago
Thinking of only allowing cred file and rearranging the flags in a major release.
The current arguments are
USAGE:
canvas-downloader [OPTIONS]
OPTIONS:
-c, --canvas-credential-path <CANVAS_CREDENTIAL_PATH>
-d, --destination-folder <DESTINATION_FOLDER> [default: .]
-h, --help Print help information
-i, --enrollment-term-ids <ENROLLMENT_TERM_IDS>...
-n, --download-newer
-s, --save-credentials
-t, --canvas-token <CANVAS_TOKEN>
-u, --canvas-url <CANVAS_URL>
I would prefer the arguments to be
USAGE:
canvas-downloader --credential-file <FILE> --term-ids <IDs>... [OPTIONS]
OPTIONS:
-c, --credential-file <FILE>
-d, --destination-folder <FOLDER> [default: .]
-h, --help Print help information
-t, --term-ids <IDs>...
-n, --download-newer
Then, the steps to get started are
cred.json
) such as the following
{
"canvas_url": "canvas.nus.edu.sg",
"canvas_token": 12345,
}
$ canvas-downloader --credential-file cred.json
Please provide the Term ID(s) to download via -t
Term IDs | Courses
115 | ["CS1101S", "CS1231S"]
120 | ["CS2040S", "CS2030"]
$ canvas-downloader --credential-file cred.json -t 115 120
Courses found:
* CS1101S
* CS1231S
...
This simplifies the tool a fair bit but can we still have the option to pass the token via the command line? I like to run the tool this way:
canvas-downloader ... --token $(fetch my token from password manager)
Don't have a very strong opinion on this though, if the feature is removed I will just find some workaround
_Originally posted by @parth-io in https://github.com/k-walter/canvas-downloader/pull/22#discussion_r1091018983_