CLI | Validate account name (Unhandled exception ValidationError: Expected str of length >= 3)
We should have a parser in the CLI so we can validate the account name and provide a nice error message instead of showing a raw error from the schemas, just like we validate it in the TUI. We should reuse this parser in all existing places where account name is accepted (e.g. in --from and --to in clive process transfer and in clive show balances, clive show accounts, etc.)
- parser should be added there: https://gitlab.syncad.com/hive/clive/-/blob/f5f5d26490a00e4b9577795a17516015275a5cd4/clive/__private/cli/common/parsers.py#L140
- validator that should be used: https://gitlab.syncad.com/hive/clive/-/blob/7728a5cad0decdda06871a5e5e3911a7f72147de/clive/__private/validators/account_name_validator.py#L13
Currently it fails like:
haf_admin@b6391f0e3dad:/workspace/clive$ clive process transfer --to a --amount 1hbd --no-broadcast
Using beekeeper at http://127.0.0.1:41371
╭─ Error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Unhandled exception ValidationError: Expected `str` of length >= 3 │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯