diff options
| -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: | 
