Title: Is there an intended way to pass modifed or added arguments from a parent parser to a one or more subparsers when using the `with_annotated` decorator? · Issue #1690 · python-cmd2/cmd2 · GitHub
Open Graph Title: Is there an intended way to pass modifed or added arguments from a parent parser to a one or more subparsers when using the `with_annotated` decorator? · Issue #1690 · python-cmd2/cmd2
X Title: Is there an intended way to pass modifed or added arguments from a parent parser to a one or more subparsers when using the `with_annotated` decorator? · Issue #1690 · python-cmd2/cmd2
Description: Question / Feature Request Is there an intended way to modify, add, or pass arguments from a parent parser to a subparser when using the with_annotated decorator? With the with_argparse approach this is straightforward because you have a...
Open Graph Description: Question / Feature Request Is there an intended way to modify, add, or pass arguments from a parent parser to a subparser when using the with_annotated decorator? With the with_argparse approach th...
X Description: Question / Feature Request Is there an intended way to modify, add, or pass arguments from a parent parser to a subparser when using the with_annotated decorator? With the with_argparse approach th...
Opengraph URL: https://github.com/python-cmd2/cmd2/issues/1690
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Is there an intended way to pass modifed or added arguments from a parent parser to a one or more subparsers when using the `with_annotated` decorator?","articleBody":"# Question / Feature Request\n\nIs there an intended way to modify, add, or pass arguments from a parent parser to a subparser when using the `with_annotated` decorator?\n\nWith the `with_argparse` approach this is straightforward because you have access to the full namespace.\n\nExample:\n\n```python\nclass App(Cmd):\n\n @with_annotated(subcommand_to=parent)\n def do_sub(...) -\u003e None:\n ... # use possibly modified parent_argument here\n\n @with_annotated(base_command=True)\n def do_parent(parent_argument: ...) -\u003e None:\n ... # possibly modify parent_argument here\n```\n\nI would like to use `parent_argument` (defined on the parent parser) in `do_sub` either as an argument *hidden* from the subparser or by accessing the full namespace of the parser.\n\nIs `ns_provider` intended for this use case? If so I cannot see how.","author":{"url":"https://github.com/neoniobium","@type":"Person","name":"neoniobium"},"datePublished":"2026-06-10T15:12:06.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1690/cmd2/issues/1690"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ebbee40e-820d-4ea8-7476-67a64f4e6ad7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9FC6:2B7857:C7457:10A525:6A4D92CD |
| html-safe-nonce | 9a60d8e6e0bbe0edeb5d74cacf29cb22292862e63f629ee832165e9b6acab79a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RkM2OjJCNzg1NzpDNzQ1NzoxMEE1MjU6NkE0RDkyQ0QiLCJ2aXNpdG9yX2lkIjoiNTgxNDA0ODkyMDU4NjUyMzM0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3d31f0d93bb46cbaf69e8eb296e6c10d0a809489c6fe0269a95e355c131f2080 |
| hovercard-subject-tag | issue:4632527702 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-cmd2/cmd2/1690/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0aa88cc11c4effc352581a0535ff6eb66bf39e3b2eac7911a3cf980e36716e09/python-cmd2/cmd2/issues/1690 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0aa88cc11c4effc352581a0535ff6eb66bf39e3b2eac7911a3cf980e36716e09/python-cmd2/cmd2/issues/1690 |
| og:image:alt | Question / Feature Request Is there an intended way to modify, add, or pass arguments from a parent parser to a subparser when using the with_annotated decorator? With the with_argparse approach th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | neoniobium |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-cmd2/cmd2 git https://github.com/python-cmd2/cmd2.git |
| octolytics-dimension-user_id | 17161025 |
| octolytics-dimension-user_login | python-cmd2 |
| octolytics-dimension-repository_id | 51442999 |
| octolytics-dimension-repository_nwo | python-cmd2/cmd2 |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51442999 |
| octolytics-dimension-repository_network_root_nwo | python-cmd2/cmd2 |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 74e2a9c78f1e38588de4f25885878349d721eedf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width