From d3b1127ab3c4671391fdf50747175fc5370dd2c3 Mon Sep 17 00:00:00 2001 From: Arthur Zakirov Date: Sat, 9 Jun 2018 18:14:47 +0300 Subject: [PATCH] Remove duplicate help command code --- src/pg_probackup.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pg_probackup.c b/src/pg_probackup.c index 9a61c5d0..a6fd22a3 100644 --- a/src/pg_probackup.c +++ b/src/pg_probackup.c @@ -271,10 +271,8 @@ main(int argc, char *argv[]) backup_subcmd = SHOW_CONFIG_CMD; else if (strcmp(argv[optind], "help") == 0) { - if (argc - optind < 2) - help_pg_probackup(); - else - help_command(argv[optind + 1]); + optind++; + help_opt = true; } else if (strcmp(argv[optind], "version") == 0) version_opt = true; @@ -284,7 +282,7 @@ main(int argc, char *argv[]) if (help_opt) { - if (backup_subcmd == NO_CMD || argc - optind < 1) + if (argc - optind < 1) help_pg_probackup(); else help_command(argv[optind]);