Skip to content

Commit

Permalink
Add toot env command
Browse files Browse the repository at this point in the history
  • Loading branch information
ihabunek committed Dec 18, 2022
1 parent c74d2ad commit 29ff629
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 8 additions & 1 deletion toot/commands.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions toot/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ def editor(value):
arguments=[],
require_auth=False,
),
Command(
name="env",
description="Print environment information for inclusion in bug reports.",
arguments=[],
require_auth=False,
),
]

TUI_COMMANDS = [
Expand Down

0 comments on commit 29ff629

Please sign in to comment.