aboutsummaryrefslogtreecommitdiffstats
path: root/todoist
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2016-02-25 13:16:40 +0100
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2016-02-25 15:00:19 +0100
commit8cc98ddcdba9928e65098ae897cba8e6383224d7 (patch)
tree1cf1881a902acb630ceb25db0d4d1bd94a505788 /todoist
parentInitial commit (diff)
downloadtodoist-8cc98ddcdba9928e65098ae897cba8e6383224d7.tar.xz
Add argument --get-token
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: