arg_print_formatted_ds does not reset column count when reaching newline
ph2355 opened this issue · 2 comments
I was redirected here from this issue: espressif/esp-idf#9907
I want to insert some newlines in my text, which the function does print, but doesn't reset the column count when encountering a newline. This results in line wrap to print a newline before reaching 80 characters in that line (or whatever number of characters line wrap is set to). Consequently I get an ugly print for which an example is provided in the above mentioned issue.
Basically this is a feature request to reset column count upon reaching a newline.
Hi @ph2355 ,
If you want to split the long lines in your own way, you should use the arg_rem
function. For example, in the ls.c
example, you can see the following code snippet:
timesty = arg_str0(NULL, "time-style","STYLE", "show times using style STYLE:"),
arg_rem (NULL, " full-iso, long-iso, iso, locale, +FORMAT"),
arg_rem (NULL, "FORMAT is interpreted like `date'; if FORMAT is"),
arg_rem (NULL, "FORMAT1<newline>FORMAT2, FORMAT1 applies to"),
arg_rem (NULL, "non-recent files and FORMAT2 to recent files;"),
arg_rem (NULL, "if STYLE is prefixed with `posix-', STYLE"),
arg_rem (NULL, "takes effect only outside the POSIX locale"),
When you run ./ls --help
, you will see the following output:
--time-style=STYLE show times using style STYLE:
full-iso, long-iso, iso, locale, +FORMAT
FORMAT is interpreted like `date'; if FORMAT is
FORMAT1<newline>FORMAT2, FORMAT1 applies to
non-recent files and FORMAT2 to recent files;
if STYLE is prefixed with `posix-', STYLE
takes effect only outside the POSIX locale
Great, thanks.