trevorld / r-argparse

command-line optional and positional argument parser
GNU General Public License v2.0
103 stars 11 forks source link

how to deal too long option help info #49

Closed felixlee0608 closed 2 months ago

felixlee0608 commented 10 months ago
image

RT.

how to change new line?

trevorld commented 10 months ago

In the future please make a minimal reproducible example enclosed in a Github markdown

```r
```

block instead of a screenshot...

You could try to use another argparse formatter. In particular one could try ArgumentParser(formatter_class="argparse.RawTextHelpFormatter)" which "maintains whitespace for all sorts of help text, including argument descriptions." You may need to manually enter a bunch of newlines and spaces where you want them but could give you the low-level formatting control you want.

If you switch from {argparse} to {optparse} then it is possible to write you own custom help formatter in R.