1
0
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:
Ivan Habunek 2024-09-29 09:24:56 +02:00
parent 2a5e823878
commit f272cc2a38
No known key found for this signature in database
GPG Key ID: 01DB3DD0D824504C
2 changed files with 14 additions and 10 deletions

View File

@ -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")

View File

@ -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()