You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
with_annotated and with_argparse decorators do not work with staticmethod #1683
changed the title [-]`with_annotated` and `with_argparse` decorators do not work with `staticmethode`[/-][+]`with_annotated` and `with_argparse` decorators do not work with `staticmethod`[/+]on Jun 10, 2026
Using a static method is kind of a strange one, since in cmd2 or cmd in general, it assumes you are working on a class that is your application. Are you trying to do a stateless command? What is the use case of such an implementation?
I'm going to close this since cmd2 makes the implicit assumption that these decorators will be used with do_* command methods within a cmd2.Cmd or cmd2.CommandSet class.
Activity
[-]`with_annotated` and `with_argparse` decorators do not work with `staticmethode`[/-][+]`with_annotated` and `with_argparse` decorators do not work with `staticmethod`[/+]KelvinChung2000 commentedon Jun 10, 2026
Using a static method is kind of a strange one, since in
cmd2orcmdin general, it assumes you are working on a class that is your application. Are you trying to do a stateless command? What is the use case of such an implementation?neoniobium commentedon Jun 10, 2026
Exactly — the idea was to use the static method to indicate that the command should be treated as "stateless."
I don’t think a feature like that is necessary, so I’m fine with closing this.
tleonhardt commentedon Jun 10, 2026
I'm going to close this since
cmd2makes the implicit assumption that these decorators will be used withdo_*command methods within acmd2.Cmdorcmd2.CommandSetclass.