Skip to content

Conversation

@tomsmeding
Copy link
Collaborator

cabal target seems to be the first cabal-install command that uses a prettyprinter for its --help output. This is all very nice, but you do need to add your own newline if you do so. :)

Template B: This PR does not modify behaviour or interface

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@ffaf1
Copy link
Collaborator

ffaf1 commented Feb 3, 2026

I am not saying this is wrong, but target output is read by other programs. Is there any risk of regressions?

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that other commands' notes have \n's (at least, CmdRun.hs).

@ulysses4ever
Copy link
Collaborator

@ffaf1 the updated text is a part of the help message, it seems.

@tomsmeding I just tried cabal target --help and I see even more than one newlines, it seems..
2026-02-03_13-02-1770142504

@ulysses4ever
Copy link
Collaborator

I've seen discrepancies regarding newlines because of the shell I use (fish). I checked in bash, and, indeed, target's help has one less newline than run's help. So, I assume it's a good change that makes things more uniform.

@tomsmeding
Copy link
Collaborator Author

tomsmeding commented Feb 3, 2026

You do not have to depend on your shell to test this. Use e.g. cabal target --help | xxd to see the actual bytes outputted by cabal; this includes one final 0x0a (i.e. a newline) for cabal run --help, and zero or one (depending on whether this PR is applied) for cabal target --help.

EDIT: Note that your shell prompt may include newlines!

@tomsmeding
Copy link
Collaborator Author

@ulysses4ever Specifically in your case, fish is helpful and prints a ⏎ character if the output of the command did not end in a newline (and then adds its own newline). So rather than showing that there are multiple newlines, your screenshot actually proves that there was none :)

@tomsmeding tomsmeding added the merge me Tell Mergify Bot to merge label Feb 3, 2026
@mergify mergify bot added the ready and waiting Mergify is waiting out the cooldown period label Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants