From b6ceb7ff2e6d01160398c5e8f8e22cb952583097 Mon Sep 17 00:00:00 2001 From: stalkerg Date: Thu, 13 Oct 2016 16:20:53 +0300 Subject: [PATCH] Gen rangedate param only for show, validate and delete command. --- expected/option.out | 8 ++++---- pg_arman.c | 15 ++++++++++----- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/expected/option.out b/expected/option.out index c2c6227e..5f8ed6c3 100644 --- a/expected/option.out +++ b/expected/option.out @@ -7,8 +7,8 @@ Usage: pg_arman OPTION init pg_arman OPTION backup pg_arman OPTION restore - pg_arman OPTION show [DATE] - pg_arman OPTION validate [DATE] + pg_arman OPTION show [DATE] [DATE] + pg_arman OPTION validate [DATE] [DATE] pg_arman OPTION delete DATE Common Options: @@ -53,8 +53,8 @@ Generic options: --help show this help, then exit --version output version information, then exit -Read the website for details. -Report bugs to . +Read the website for details. +Report bugs to . 1 ###### COMMAND OPTION TEST-0002 ###### diff --git a/pg_arman.c b/pg_arman.c index f01b0595..19a2f177 100644 --- a/pg_arman.c +++ b/pg_arman.c @@ -16,8 +16,8 @@ #include const char *PROGRAM_VERSION = "0.1"; -const char *PROGRAM_URL = "https://github.com/michaelpq/pg_arman"; -const char *PROGRAM_EMAIL = "https://github.com/michaelpq/pg_arman/issues"; +const char *PROGRAM_URL = "https://github.com/stalkerg/pg_arman"; +const char *PROGRAM_EMAIL = "https://github.com/stalkerg/pg_arman/issues"; /* path configuration */ char *backup_path; @@ -109,8 +109,13 @@ main(int argc, char *argv[]) for (; i < argc; i++) { if (cmd == NULL) + { cmd = argv[i]; - else if (range1 == NULL) + if(strcmp(cmd, "show") != 0 && + strcmp(cmd, "validate") != 0 && + strcmp(cmd, "delete") != 0) + break; + } else if (range1 == NULL) range1 = argv[i]; else if (range2 == NULL) range2 = argv[i]; @@ -229,8 +234,8 @@ pgut_help(bool details) printf(_(" %s OPTION init\n"), PROGRAM_NAME); printf(_(" %s OPTION backup\n"), PROGRAM_NAME); printf(_(" %s OPTION restore\n"), PROGRAM_NAME); - printf(_(" %s OPTION show [DATE]\n"), PROGRAM_NAME); - printf(_(" %s OPTION validate [DATE]\n"), PROGRAM_NAME); + printf(_(" %s OPTION show [DATE] [DATE]\n"), PROGRAM_NAME); + printf(_(" %s OPTION validate [DATE] [DATE]\n"), PROGRAM_NAME); printf(_(" %s OPTION delete DATE\n"), PROGRAM_NAME); if (!details)