diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2016-02-25 13:16:40 +0100 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2016-02-25 15:00:19 +0100 |
commit | 8cc98ddcdba9928e65098ae897cba8e6383224d7 (patch) | |
tree | 1cf1881a902acb630ceb25db0d4d1bd94a505788 | |
parent | Initial commit (diff) | |
download | todoist-8cc98ddcdba9928e65098ae897cba8e6383224d7.tar.xz |
Add argument --get-token
-rwxr-xr-x | todoist | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -18,6 +18,9 @@ def arg_parser(): metavar="ACCESS_TOKEN_STRING", help="Store or change access token", type=str) + parser.add_argument("--get-token", + help="Get current token (e.g. for revocation)", + action="store_true") parser.add_argument("--dump", help="Dump data to file to " + DUMP_FILENAME + " and exit", action="store_true") @@ -74,6 +77,10 @@ def main(): print("Couldn't read token. Is token stored?", file=sys.stderr) sys.exit(1) + if args.get_token: + print(token) + sys.exit(0) + api = todoist.TodoistAPI(token) data = api.sync(resource_types=['all']) if "error" in data: |