mirror of
https://github.com/ihabunek/toot
synced 2024-12-22 07:01:46 +01:00
Deprecate toot env in favour of toot diag
This commit is contained in:
parent
2a5e823878
commit
f272cc2a38
@ -1,13 +1,13 @@
|
||||
import click
|
||||
import platform
|
||||
import sys
|
||||
import webbrowser
|
||||
|
||||
from toot import api, config, __version__
|
||||
import click
|
||||
|
||||
from toot import api, config
|
||||
from toot.auth import get_or_create_app, login_auth_code, login_username_password
|
||||
from toot.cli import AccountParamType, cli
|
||||
from toot.cli.diag import print_diag
|
||||
from toot.cli.validators import validate_instance
|
||||
|
||||
from toot.output import print_warning
|
||||
|
||||
instance_option = click.option(
|
||||
"--instance", "-i", "base_url",
|
||||
@ -42,12 +42,12 @@ def auth():
|
||||
click.echo(f"\nAuth tokens are stored in: {path}")
|
||||
|
||||
|
||||
@cli.command()
|
||||
@cli.command(hidden=True)
|
||||
def env():
|
||||
"""Print environment information for inclusion in bug reports."""
|
||||
click.echo(f"toot {__version__}")
|
||||
click.echo(f"Python {sys.version}")
|
||||
click.echo(platform.platform())
|
||||
"""Deprecated in favour of 'diag'"""
|
||||
print_warning("`toot env` is deprecated in favour of `toot diag`")
|
||||
click.echo()
|
||||
print_diag(False, False)
|
||||
|
||||
|
||||
@cli.command(name="login_cli")
|
||||
|
@ -41,6 +41,10 @@ DIAG_DEPENDENCIES = [
|
||||
)
|
||||
def diag(files: bool, server: bool):
|
||||
"""Display useful information for diagnosing problems"""
|
||||
print_diag(files, server)
|
||||
|
||||
|
||||
def print_diag(files: bool, server: bool):
|
||||
instance: Optional[Instance] = None
|
||||
if server:
|
||||
_, app = config.get_active_user_app()
|
||||
|
Loading…
Reference in New Issue
Block a user