-
Hi, how are you ? hope you doing great :) Is this possible ? It seems the answer currently is no @cappa.command(
help="Enhance your Django developer experience: CLI and Guides for the Modern Django Developer.",
)
class Falco:
subcommand: cappa.Subcommands[StartProject | UpdateProject | Fmt | SyncDotenv]
version: Annotated[
bool,
cappa.Arg(
short="-v",
long="--version",
help="print cli version",
),
] = False I feel like the only option is to implement version as a subcommand |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
you can do I believe you should also be able to define it on the class itself if you prefer, by setting |
Beta Was this translation helpful? Give feedback.
you can do
cappa.parse/invoke(Falco, version='1.2.3')
(orversion=cappa.Arg('1.2.3', short="-v", long="--version", help="print cli version")
if the default arg definition isn't what you want).I believe you should also be able to define it on the class itself if you prefer, by setting
action=ArgAction.version
. Although i personally wouldn't, because it doesn't really make sense as a normal class field, given that it will always just be the default value if not used.