Reorder options and subcommands to show alphabetically
When you run devproxy -h it shows the list of available options and subcommands. Both, are displayed in the order they're registered rather than alphabetically which complicates the lookup. Let's change the order to be alphabetical.
Can I handle this ? But, I've some issues when try to debug solution. I got a forked, cloned and try dotnet run build, no errors show but.
Awesome! Please do! What kind of issues do you have?
I started by installing Dev Proxy on my local machine using the link: Docs As you can see in the image, the Dev Proxy options are displayed.
Next, I forked the project and cloned it into my local environment. I opened the project solution using Visual Studio, created a feature branch, and built the application.
However, I’m unable to debug it. When I run the application, the following terminal appears.
I know where the commands and subcommands for Dev Proxy are registered, but I want to see them when running my application. This way, I can change the order in which commands and subcommands are created and observe the results.
I have .NET versions 6, 8, and 9 installed.
Long Story Short:
How can I view the options from devproxy -h based on the application running from my development environment, rather than the configuration set on my machine?
You mentioned that you installed Dev Proxy first before you cloned the repo. I think what's happening, is that you're starting the installed version rather than the version from the cloned repo. I suggest that you uninstall Dev Proxy, then build it and start the version from the build output folder.
@waldekmastykarz
I uninstalled DevProxy, ran dotnet build, and verified the build output folder.
I thought the .exe I should execute is this one, correct?
It opens a terminal and indicates the local address to access, but when attempting to access it, an error is displayed.
All is working fine! Dev Proxy is not a website you can access in a browser. You use it similarly to Fiddler where you configure it as a proxy on your machine and which the intercepts web requests from the applications.
Got it! I know I need to change those lines to sort alphabetically. Here’s the link: https://github.com/dotnet/dev-proxy/blob/main/dev-proxy/ProxyHost.cs#L338
Once I’ve done that, I just want to make sure my changes actually worked. After building, how can I check it?
After you build your project, run devproxy -h. Options and subcommands should show alphabetically sorted.
Hey @caiovlima, are you still working on this?
Opening up due to lack of response
I am working on it.
I expect some refactoring of ProxyHost . Alphabetical sorting will be on our end, it does not look that System.CommandLine API has anything for this or will be in the next release (for now it is a v2-beta4 released 3 years ago).