aboutsummaryrefslogtreecommitdiffstats
path: root/todoist
diff options
context:
space:
mode:
Diffstat (limited to 'todoist')
-rwxr-xr-xtodoist7
1 files changed, 7 insertions, 0 deletions
diff --git a/todoist b/todoist
index 5d16e14..66c42ab 100755
--- a/todoist
+++ b/todoist
@@ -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: