mas icon indicating copy to clipboard operation
mas copied to clipboard

Improve mas upgrade output

Open rgoldberg opened this issue 4 years ago • 3 comments

Improve mas upgrade output from:

Upgrading 2 outdated applications:
Transporter (1.2.1), Developer (9.2)
==> Downloading Transporter
==> Installed Transporter
==> Downloading Apple Developer
==> Installed Apple Developer

Also, Downloading should be changed to Downloaded after the download has completed.

Maybe the displayed app names should be consistent, instead of using Developer at the top, and Apple Developer at the bottom. I assume we should use the longer name everywhere.

Describe the solution you'd like

Improve mas upgrade output to something like:

Upgrading 2 outdated applications:

Transporter 1.2.1 -> 1.2.2
Apple Developer 9.2 -> 9.2.1

==> Downloaded Transporter 1.2.2
==> Installed Transporter 1.2.2
==> Downloaded Apple Developer 9.2.1
==> Installed Apple Developer 9.2.1

Describe alternatives you've considered Possibly use the shorter name everywhere.

Would be nice to space the the versions out in a table-spaced format (without borders) to make everything more readable, but I'd have to find some text spacing library. Not gonna spend time writing one myself. e.g.:

Upgrading 2 outdated applications:

Transporter     1.2.1 -> 1.2.2
Apple Developer 9.2   -> 9.2.1

==> Downloaded Transporter     1.2.2
==> Installed  Transporter     1.2.2
==> Downloaded Apple Developer 9.2.1
==> Installed  Apple Developer 9.2.1

rgoldberg avatar Jun 04 '21 15:06 rgoldberg

I agree the existing output can be a little confusing. It's not always clear whether mas is showing the existing app version or the version to be upgraded. There's also confusion between bundle version, bundle short version, and App Store version, which don't always match, but that's probably outside the scope of this issue.

@rgoldberg, did you want to try putting together a pull request for this one? If you're interested, it seems like something that somebody new to Swift could pick up.

chris-araman avatar Jun 04 '21 16:06 chris-araman

Yeah, I'm happy to create a PR.

@chris-araman: Do you know a Swift text formatting utility that can output plaintext in columns?

rgoldberg avatar Jun 04 '21 17:06 rgoldberg

I don't think a library will be necessary for tabulation. Take a look at the existing Formatters.

chris-araman avatar Jun 04 '21 18:06 chris-araman