@@ -133,8 +133,10 @@ main(int argc, char *argv[])
133
133
backup_subcmd = SHOW ;
134
134
else if (strcmp (argv [1 ], "delete" ) == 0 )
135
135
backup_subcmd = DELETE ;
136
- else if (strcmp (argv [1 ], "config" ) == 0 )
137
- backup_subcmd = CONFIGURE ;
136
+ else if (strcmp (argv [1 ], "set-config" ) == 0 )
137
+ backup_subcmd = SET_CONFIG ;
138
+ else if (strcmp (argv [1 ], "show-config" ) == 0 )
139
+ backup_subcmd = SHOW_CONFIG ;
138
140
else if (strcmp (argv [1 ], "--help" ) == 0
139
141
|| strcmp (argv [1 ], "help" ) == 0
140
142
|| strcmp (argv [1 ], "-?" ) == 0 )
@@ -170,7 +172,7 @@ main(int argc, char *argv[])
170
172
elog (ERROR , "-B, --backup-path must be a path to directory" );
171
173
172
174
/* Do not read options from file or env if we're going to set them */
173
- if (backup_subcmd != CONFIGURE )
175
+ if (backup_subcmd != SET_CONFIG )
174
176
{
175
177
/* Read options from configuration file */
176
178
join_path_components (path , backup_path , BACKUP_CATALOG_CONF_FILE );
@@ -248,12 +250,14 @@ main(int argc, char *argv[])
248
250
return do_retention_purge ();
249
251
else
250
252
return do_delete (current .backup_id );
251
- case CONFIGURE :
252
- /* TODO fixit */
253
+ case SHOW_CONFIG :
254
+ if (argc > 4 )
255
+ elog (ERROR , "show-config command doesn't accept any options" );
256
+ return do_configure (true);
257
+ case SET_CONFIG :
253
258
if (argc == 4 )
254
- return do_configure (true);
255
- else
256
- return do_configure (false);
259
+ elog (ERROR , "set-config command requires at least one option" );
260
+ return do_configure (false);
257
261
}
258
262
259
263
return 0 ;
0 commit comments