From b56c7edb88faf8f307ad31de82aac5701eef11db Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:05:48 +0330 Subject: [PATCH] Added --country option --- core/cli.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/cli.py b/core/cli.py index bb27e28..adf918e 100644 --- a/core/cli.py +++ b/core/cli.py @@ -289,10 +289,14 @@ def ip_address(edit, ipv4, ipv6): run_cmd(['bash', Command.IP_ADD.value, 'add']) @cli.command('update-geo') -def cli_update_geo(): +@click.option('--country', '-c', + type=click.Choice(['iran', 'china', 'russia'], case_sensitive=False), + default='iran', + help='Select country for geo files (default: iran)') +def cli_update_geo(country): script_path = Command.UPDATE_GEO.value try: - subprocess.run(['python3', script_path], check=True) + subprocess.run(['python3', script_path, country.lower()], check=True) except subprocess.CalledProcessError as e: print(f"Failed to update geo files: {e}") except FileNotFoundError: