perslev / CanvasSync

Synchronise modules, assignments and files located on a Canvas by Instructure web server to your local computer.
MIT License
68 stars 33 forks source link

Add command-line arguments for syncing and specifying password #6

Closed LuxMiranda closed 7 years ago

LuxMiranda commented 7 years ago

This implements the feature of triggering the sync without needing to go through the interactive interface. For example:

canvas.py -S

or

canvas.py --sync

This will prompt for the decryption password and then synchronize. If one wishes to bypass the password prompt, one may type:

canvas.py --S -p myPassword

or

canvas.py --sync -p myPassword

If you do this, you'll additionally get the message:

Warning: entering password via command line can be dangerous

Aside from convenience, this also allows shell scripts and the like to interact with CanvasSync in a very easy way. Personally, I really wanted these features so that I could make a cron job that will automatically sync my Canvas files every day!