Skip to content

Nested Verbs #675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MoeFarag opened this issue Aug 8, 2020 · 2 comments
Closed

Nested Verbs #675

MoeFarag opened this issue Aug 8, 2020 · 2 comments

Comments

@MoeFarag
Copy link

MoeFarag commented Aug 8, 2020

I've tried to create nested verbs like many CLIs

Example (from docker CLI)

  • docker image ls and docker image rm

I tried the following two ways but it didn't work (following above example commands).

  • Spaced Verb
[Verb("image ls"]
public class ImageListOptions {}
  • Nested Verbs
[Verb("image"]
public class ImageOptions {
    [Verb("ls"]
    public class ListOptions{ }
}

If this is not supported, then I suggest adding it - I could contribute to getting it done as well. I would suggest going with the Nested Verbs approach if the current code base would allow it.

@Olympic1
Copy link

Olympic1 commented Aug 9, 2020

See #353 for discussion about sub verbs
and #13

@MoeFarag
Copy link
Author

Thanks @Olympic1 for pointing me to the discussions #13 seems to be pretty old and outdated by now. #353 seems to be a discussions that got lost but has multiple ideas to implement

Below are the candidates but also the discussion has many insights
https://github.com/twaalewijn/commandlineparser-subverbextension
https://github.com/edongashi/CommandlineChildVerbs (that uses the old api though)

I Believe #353 stays the most relevant open discussion about the topic. Closing this one to avoid dupes. and moving discussion there in future.

I'll get back to that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants