© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
BlakeFL

✅ System.CommandLine -> How to create a option without a parameter?

If I wanted to create an option that does not need anything passed into it how does that work with the latest version? I tried passing nothing to a nullable string option but that did not work. It seems like this might have worked with new Option() without type <t> before but that was removed in the newest version.

Desired result:
cmd input -> "tool servers -list"
cmd response -> list of servers from api call or config file.
servers is the subcommand and -list would be an option.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

[System.Commandline] how to exit on --help
C#CC# / help
3y ago
System.CommandLine and injection of IOptions (not Option!) type
C#CC# / help
4y ago
❔ Default command in System.CommandLine
C#CC# / help
3y ago
❔ how to create database for simple login system
C#CC# / help
3y ago