Align installed command output into columns for interactive terminals #134
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The intent of #23 was to make it possible to get the path of installed Xcodes more easily, which was implemented by #133. I realized after I wrote the description of that issue that it should be possible to both make the output nice for humans and also make it easy to pipe to other commands to get the paths for scripting purposes. This PR makes that change.
If standard output is an interactive terminal, which is what you'll see most of the time as a user, space will be added between the two columns so that it's easy to read. If standard output is not an interactive terminal, like when you pipe the output to another command or a file, then no spaces will be added and the current behaviour of adding a tab character will be used.
The expected behaviour is below, which you can try out to verify.
When printing to an interactive terminal:
When not printing to an interactive terminal: