deno-cliffy icon indicating copy to clipboard operation
deno-cliffy copied to clipboard

Command help output is always indented

Open commure-stabai opened this issue 2 years ago • 6 comments

I'm not certain why the help output is always indented, but it would be great if that could at least be turned off. https://github.com/c4spar/deno-cliffy/blob/46a2b833dbc89754073d4bad6e753bca19184f11/command/help/_help_generator.ts#L81

This doesn't seem standard to most CLIs I've used, but if it's generally desirable, making indent configurable as a field on HelpOptions could be an easy solution to please everyone.

commure-stabai avatar Sep 27 '21 22:09 commure-stabai

hi @dontstabai, thx for your feedback!

I like the indentation but it's fine for me to make it configurable. Is it only about the indentation or also about the line breaks at the beginning and end of the help text?

c4spar avatar Sep 28 '21 19:09 c4spar

Hi @c4spar. It's just the base indentation that's awkward to me. If I have some other output shown with the usage info (e.g. 'Error: Command "blah" not recognized'), it looks slightly awkward. I could indent that too, but it might not always come from a situation where I know it's in this special UI state.

I like the line breaks and the indents within each section a lot though! That and the colors make it make it very readable, which I really appreciate.

I just want this:

  Usage:   foo
  Version: 0.1.0

  Description:

    Foos all the bars

Error: Command "blah" not recognized

To look more like this:

Usage:   foo
Version: 0.1.0

Description:

  Foos all the bars

Error: Command "blah" not recognized

Thanks for accepting, and I'll send over a PR whenever I have a chance.

commure-stabai avatar Oct 15 '21 00:10 commure-stabai

@dontstabai i think i agree. feel free to open a pr. i was thinking about adding and indent option to the .help() method. but the problem is the error message is also indented and at this place we have no access to the help options currently. so we would need to store the help options. but if it takes to much time, i think i'm also fine with just removing the indentation without making it configurable.

c4spar avatar Oct 18 '21 22:10 c4spar

I finally got around to doing this, but I can't push my branch for a PR. I get:

remote: Permission to c4spar/deno-cliffy.git denied to dontstabai.
fatal: unable to access 'https://github.com/c4spar/deno-cliffy.git/': The requested URL returned error: 403

Do I need permission to push? (sorry if this is a dumb question, I've been using another version control system for years and still getting used to git)

commure-stabai avatar Nov 03 '21 05:11 commure-stabai

Hi @dontstabai, cool 👍 you need to create a fork of the cliffy repo and than push your changes to the forked repo. Than you can open a pull request to merge your changes into the main repo.

c4spar avatar Nov 03 '21 15:11 c4spar

Oh, right! Thank you, will do.

commure-stabai avatar Nov 03 '21 15:11 commure-stabai