mirror of
https://github.com/ihabunek/toot.git
synced 2024-11-03 04:17:21 -05:00
Add toot env command
This commit is contained in:
parent
c74d2ad916
commit
29ff629464
@ -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)
|
||||
|
@ -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 = [
|
||||
|
Loading…
Reference in New Issue
Block a user