Skip to content

Commit e35d5df

Browse files
committed
fix questionary select default bug
1 parent e471d09 commit e35d5df

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎o2switch_cli/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__all__ = ["__version__"]
22

3-
__version__ = "0.1.2"
3+
__version__ = "0.1.3"

‎o2switch_cli/cli/config_cmd.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,11 @@ def action(app_context):
105105
auth_choice = questionary.select(
106106
"Authentication method:",
107107
choices=[
108-
{"name": "Password (cPanel login password)", "value": "password"},
109-
{"name": "API Token (generate in cPanel > Security > Manage API Tokens)", "value": "token"},
108+
"Password (cPanel login password)",
109+
"API Token (generate in cPanel > Security > Manage API Tokens)",
110110
],
111-
default="password",
112111
).ask()
113-
auth_method = auth_choice or "password"
112+
auth_method = "token" if auth_choice and "Token" in auth_choice else "password"
114113

115114
host = cpanel_host or current.cpanel_host
116115
user = cpanel_user or current.cpanel_user

‎o2switch_cli/core/cpanel_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self, settings: AppSettings, client: httpx.Client | None = None) ->
1919
use_basic = settings.auth_method == "password"
2020
headers = {
2121
**auth_header(settings.cpanel_user, settings.cpanel_token, use_basic=use_basic), # type: ignore[arg-type]
22-
"User-Agent": "o2switch-cli/0.1.2",
22+
"User-Agent": "o2switch-cli/0.1.3",
2323
"Accept": "application/json",
2424
}
2525
self._client = client or httpx.Client(

0 commit comments

Comments
 (0)