comonicon / Comonicon.jl

Your best CLI generator in JuliaLang
https://comonicon.org
MIT License
282 stars 25 forks source link

Control the empty lines in the usage doc #256

Open songtaogui opened 11 months ago

songtaogui commented 11 months ago

The generated Usage contains many empty lines, I understand this may help for better layout when the usages are short. However, when the options gets complicated, the whole usage doc would become too long. Is there an option that I could control the empty lines?

for example, the generated usage of the Quick Start demo is:


  sum

Usage

  sum <args> [options] [flags]

Args

  <x>                                                       first number.

  <y>                                                       second number.

Options

  -p, --precision <type>                                    prescision of the calculation.

Flags

  -f, --fastmath                                            enable fastmath.

  -h, --help                                                Print this help message.
  --version                                                 Print version.

however, I prefer sth like:

  sum

Usage
  sum <args> [options] [flags]

Args
  <x>                                                       first number.
  <y>                                                       second number.

Options
  -p, --precision <type>                                    prescision of the calculation.

Flags
  -f, --fastmath                                            enable fastmath.

  -h, --help                                                Print this help message.
  --version                                                 Print version.

All the best! Version of the package:

Status `~/.julia/environments/v1.9/Project.toml`
  [863f3e99] Comonicon v1.0.6
nothing
songtaogui commented 11 months ago

sorry for automatically labeled this issue as [bug], it is more like a [request]. lol

Roger-luo commented 11 months ago

Yeah, this is because Comonicon was developed in pre-1.9 era, so we have to eliminate as much runtime as possible, resulting in non-adaptive printings. I believe in 1.9+ because of pkgimage, just doing dynamic printing can still have a reasonable latency. But I personally won't have much time working on this package this year. So any large changes will need to wait for next year after I graduate.