Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help for a command: description section adds an extra newline per line #518

Closed
shazron opened this issue Oct 12, 2022 · 1 comment · Fixed by #519
Closed

help for a command: description section adds an extra newline per line #518

shazron opened this issue Oct 12, 2022 · 1 comment · Fixed by #519
Labels
bug Something isn't working

Comments

@shazron
Copy link

shazron commented Oct 12, 2022

Describe the bug

When running --help for a command, a long description (with paragraphs) adds an extra newline per line. This was working as expected in oclif@v1.

To Reproduce

const { Command } = require('@oclif/core')

class MobyDickCommand extends Command {
  async run () {
    this.log('Do nothing')
  }
}

MobyDickCommand.description = `Call me Ishmael. 

Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to
interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way
I have of driving off the spleen and regulating the circulation. 

Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever
I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; 
and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent
me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high
time tozz get to sea as soon as I can. 

This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword;
I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in 
their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.
`

module.exports = MobyDickCommand

Steps to reproduce the behavior:

  1. Call the command above with a --help flag
  2. Take note of the DESCRIPTION section

Expected behavior

DESCRIPTION Output:

DESCRIPTION
  Call me Ishmael. 
  
  Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to
  interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way
  I have of driving off the spleen and regulating the circulation. 
  
  Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever
  I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet; 
  and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent
  me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high
  time tozz get to sea as soon as I can. 
  
  This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword;
  I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in 
  their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.

Actual behavior

DESCRIPTION Output:

DESCRIPTION
  Call me Ishmael.

  Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to

  interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way

  I have of driving off the spleen and regulating the circulation.

  Whenever I find myself growing grim about the mouth; whenever it is a damp, drizzly November in my soul; whenever

  I find myself involuntarily pausing before coffin warehouses, and bringing up the rear of every funeral I meet;

  and especially whenever my hypos get such an upper hand of me, that it requires a strong moral principle to prevent

  me from deliberately stepping into the street, and methodically knocking people’s hats off—then, I account it high

  time tozz get to sea as soon as I can.

  This is my substitute for pistol and ball. With a philosophical flourish Cato throws himself upon his sword;

  I quietly take to the ship. There is nothing surprising in this. If they but knew it, almost all men in

  their degree, some time or other, cherish very nearly the same feelings towards the ocean with me.

Environment (please complete the following information):

  • OS & version: macOS 12.5.1
  • Shell/terminal & version: zsh
@shazron shazron changed the title command descriptions add newlines help for a command: description section adds an extra newline per line Oct 12, 2022
@mdonnalley mdonnalley added the bug Something isn't working label Oct 12, 2022
@git2gus
Copy link

git2gus bot commented Oct 12, 2022

This issue has been linked to a new work item: W-11894064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants