Skip to content

Commit

Permalink
✨ arg which type is Any or AnyString will hide by formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed May 10, 2023
1 parent f5cf297 commit 6c66146
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/arclet/alconna/formatter.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from __future__ import annotations

from contextlib import suppress
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any
from tarina import Empty, lang
from nepattern import AllParam, BasePattern
from nepattern import AllParam, AnyOne, AnyString

from .args import Arg, Args
from .base import Option, Subcommand
Expand Down Expand Up @@ -189,7 +188,8 @@ def param(self, parameter: Arg) -> str:
if parameter.value is AllParam:
return f"<...{name}>"
arg = f"[{name}" if parameter.optional else f"<{name}"
arg += f": {parameter.value}"
if parameter.value not in (AnyOne, AnyString):
arg += f": {parameter.value}"
if parameter.field.display is Empty:
arg += " = None"
elif parameter.field.display is not None:
Expand Down

0 comments on commit 6c66146

Please sign in to comment.