Add toot env command

This commit is contained in:
Ivan Habunek 2022-12-11 23:46:54 +01:00
parent c74d2ad916
commit 29ff629464
No known key found for this signature in database
GPG key ID: CDBD63C43A30BB95
2 changed files with 14 additions and 1 deletions

View file

@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
import sys
import platform
from datetime import datetime, timedelta, timezone
from toot import api, config
from toot import api, config, __version__
from toot.auth import login_interactive, login_browser_interactive, create_app_interactive
from toot.exceptions import ApiError, ConsoleError
from toot.output import (print_out, print_instance, print_account, print_acct_list,
@ -220,6 +221,12 @@ def auth(app, user, args):
print_out("\nAuth tokens are stored in: <blue>{}</blue>".format(path))
def env(app, user, args):
print_out(f"toot {__version__}")
print_out(f"Python {sys.version}")
print_out(platform.platform())
def login_cli(app, user, args):
app = create_app_interactive(instance=args.instance, scheme=args.scheme)
login_interactive(app, args.email)

View file

@ -223,6 +223,12 @@ AUTH_COMMANDS = [
arguments=[],
require_auth=False,
),
Command(
name="env",
description="Print environment information for inclusion in bug reports.",
arguments=[],
require_auth=False,
),
]
TUI_COMMANDS = [