Refactor cli_api.py and cli.py

This commit is contained in:
Iam54r1n4
2025-01-26 12:50:14 +00:00
parent 403ec33648
commit 772096922d
2 changed files with 9 additions and 9 deletions

View File

@ -80,9 +80,9 @@ def change_hysteria2_sni(sni: str):
@cli.command('backup-hysteria')
def backup_hysteria():
def backup_hysteria2():
try:
cli_api.backup_hysteria()
cli_api.backup_hysteria2()
click.echo("Hysteria configuration backed up successfully.")
except Exception as e:
click.echo(f'{e}', err=True)
@ -216,10 +216,10 @@ def manage_obfs(remove: bool, generate: bool):
if remove and generate:
raise click.UsageError('Error: You cannot use both --remove and --generate at the same time')
elif generate:
cli_api.generate_hysteria_obfs()
cli_api.enable_hysteria2_obfs()
click.echo("Obfs generated successfully.")
elif remove:
cli_api.remove_hysteria_obfs()
cli_api.disable_hysteria2_obfs()
click.echo("Obfs removed successfully.")
except Exception as e:
click.echo(f'{e}', err=True)