clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
426 stars 39 forks source link

System command line full upgrade #120

Closed Keboo closed 1 year ago

Keboo commented 2 years ago

I wanted to open this so you could see the current progress and provide any feedback. I still have more work to do on it, but this should give you a decent idea of the direction I am heading down.

caesay commented 2 years ago

Just copying what I posted to Discord for visibility:

Just saw your latest push to the PR. I thought I had mentioned this already but perhaps not. I think we should probably leave the Update.Windows command line alone. There are lots of electron/non-C# apps that rely on this API and I'm not sure I want to make breaking changes to it at this point. Happy to discuss but my general feeling is: Breaking the CLI tool? fine. Breaking an installed app because they didn't read the docs when upgrading to a newer version? Probably less fine. Happy to migrate Update.Mac as it's a brand new binary and only has one command which is used by Squirrel internally anyway.

Keboo commented 2 years ago

I believe this is ready for review.

caesay commented 2 years ago

Thanks for your hard work on this! I should have time to go through this a bit later this week.

caesay commented 2 years ago

Is it possible to reduce the maximum character wrap length in the help text to be consistent with Mono.Options? (80 char). I had a look at replacing rootCommand.Invoke with CommandLineBuilder(rootCommand).UseHelp(80).Invoke but this didn't seem to have any effect.

Keboo commented 2 years ago

Is it possible to reduce the maximum character wrap length in the help text to be consistent with Mono.Options? (80 char). I had a look at replacing rootCommand.Invoke with CommandLineBuilder(rootCommand).UseHelp(80).Invoke but this didn't seem to have any effect.

Yea that API should have worked the way you expected. There is a bug in the current release that ignores the requested maxWidth and uses the terminal's size instead. I have put in a workaround for this, and submitted a PR to fix the underlying issue. https://github.com/dotnet/command-line-api/pull/1864

caesay commented 2 years ago

uses the terminal's size instead.

I wouldn't mind this behaviour (auto sizing to terminal instead of hard-coded) but it didn't work this way for me. It ended up always setting the width a bit too wide so all the lines wrapped awkwardly until I enlarged my terminal.