table

Помоћни програм из командне линије за форматирање и приказ CSV-а
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување bfd20a4ca71953b1b4d8ddf41a6a9eaecbac26ba
родитељ 0b2747f984e1a95eff2423de8cb3861231990aa6
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Fri,  7 Apr 2023 16:35:59 +0200

table.c(main): Handle parameter arguments not separated by whitespace (like "-d:"); change -p message to be on the same line as the cursor

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mtable.c | 8+++++++-
измењених датотека: 1, додавања: 7(+), брисања: 1(-)

diff --git a/table.c b/table.c @@ -380,6 +380,7 @@ main(int argc, char** argv) do_arg: arg = *++argv; + if (!arg) goto done_arg; @@ -498,10 +499,14 @@ do_arg: error(EINVAL, "Invalid argument: -%c", c); return usage(); } + /* Gobble up the rest of the arg ("-d:" etc) */ + if (*arg) + goto continue_current_arg; } } else { +continue_current_arg: if (cmd == CMD_COLUMNS) { if (set_columns(arg, &rune_columns)) @@ -920,7 +925,8 @@ done_input: if (pause) { char buf[BUFSIZE]; - printf("Press Enter to continue\n"); + printf("Press Enter to continue: "); + fflush(stdout); clearerr(stdin); fgets(buf, BUFSIZE, stdin); }