Skip to content

Commit b6ceb7f

Browse files
committed
Gen rangedate param only for show, validate and delete command.
1 parent c678325 commit b6ceb7f

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

expected/option.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Usage:
77
pg_arman OPTION init
88
pg_arman OPTION backup
99
pg_arman OPTION restore
10-
pg_arman OPTION show [DATE]
11-
pg_arman OPTION validate [DATE]
10+
pg_arman OPTION show [DATE] [DATE]
11+
pg_arman OPTION validate [DATE] [DATE]
1212
pg_arman OPTION delete DATE
1313

1414
Common Options:
@@ -53,8 +53,8 @@ Generic options:
5353
--help show this help, then exit
5454
--version output version information, then exit
5555

56-
Read the website for details. <https://github.com/michaelpq/pg_arman>
57-
Report bugs to <https://github.com/michaelpq/pg_arman/issues>.
56+
Read the website for details. <https://github.com/stalkerg/pg_arman>
57+
Report bugs to <https://github.com/stalkerg/pg_arman/issues>.
5858
1
5959

6060
###### COMMAND OPTION TEST-0002 ######

pg_arman.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include <sys/stat.h>
1717

1818
const char *PROGRAM_VERSION = "0.1";
19-
const char *PROGRAM_URL = "https://github.com/michaelpq/pg_arman";
20-
const char *PROGRAM_EMAIL = "https://github.com/michaelpq/pg_arman/issues";
19+
const char *PROGRAM_URL = "https://github.com/stalkerg/pg_arman";
20+
const char *PROGRAM_EMAIL = "https://github.com/stalkerg/pg_arman/issues";
2121

2222
/* path configuration */
2323
char *backup_path;
@@ -109,8 +109,13 @@ main(int argc, char *argv[])
109109
for (; i < argc; i++)
110110
{
111111
if (cmd == NULL)
112+
{
112113
cmd = argv[i];
113-
else if (range1 == NULL)
114+
if(strcmp(cmd, "show") != 0 &&
115+
strcmp(cmd, "validate") != 0 &&
116+
strcmp(cmd, "delete") != 0)
117+
break;
118+
} else if (range1 == NULL)
114119
range1 = argv[i];
115120
else if (range2 == NULL)
116121
range2 = argv[i];
@@ -229,8 +234,8 @@ pgut_help(bool details)
229234
printf(_(" %s OPTION init\n"), PROGRAM_NAME);
230235
printf(_(" %s OPTION backup\n"), PROGRAM_NAME);
231236
printf(_(" %s OPTION restore\n"), PROGRAM_NAME);
232-
printf(_(" %s OPTION show [DATE]\n"), PROGRAM_NAME);
233-
printf(_(" %s OPTION validate [DATE]\n"), PROGRAM_NAME);
237+
printf(_(" %s OPTION show [DATE] [DATE]\n"), PROGRAM_NAME);
238+
printf(_(" %s OPTION validate [DATE] [DATE]\n"), PROGRAM_NAME);
234239
printf(_(" %s OPTION delete DATE\n"), PROGRAM_NAME);
235240

236241
if (!details)

0 commit comments

Comments
 (0)