@@ -107,7 +107,9 @@ usage(void)
107107printf (_ ("\nOptions controlling the output:\n" ));
108108printf (_ (" -D, --pgdata=DIRECTORY receive base backup into directory\n" ));
109109printf (_ (" -F, --format=p|t output format (plain (default), tar)\n" ));
110- printf (_ (" -x, --xlog=fetch|stream include required WAL files in backup\n" ));
110+ printf (_ (" -x, --xlog include required WAL files in backup (fetch mode)\n" ));
111+ printf (_ (" -X, --xlog-method=fetch|stream\n"
112+ " include required WAL files with specified method\n" ));
111113printf (_ (" -z, --gzip compress tar output\n" ));
112114printf (_ (" -Z, --compress=0-9 compress tar output with given compression level\n" ));
113115printf (_ ("\nGeneral options:\n" ));
@@ -1194,7 +1196,8 @@ main(int argc, char **argv)
11941196{"pgdata" ,required_argument ,NULL ,'D' },
11951197{"format" ,required_argument ,NULL ,'F' },
11961198{"checkpoint" ,required_argument ,NULL ,'c' },
1197- {"xlog" ,required_argument ,NULL ,'x' },
1199+ {"xlog" ,no_argument ,NULL ,'x' },
1200+ {"xlog-method" ,required_argument ,NULL ,'X' },
11981201{"gzip" ,no_argument ,NULL ,'z' },
11991202{"compress" ,required_argument ,NULL ,'Z' },
12001203{"label" ,required_argument ,NULL ,'l' },
@@ -1230,7 +1233,7 @@ main(int argc, char **argv)
12301233}
12311234}
12321235
1233- while ((c = getopt_long (argc ,argv ,"D:F:x :l:zZ:c:h:p:U:s:wWvP" ,
1236+ while ((c = getopt_long (argc ,argv ,"D:F:xX :l:zZ:c:h:p:U:s:wWvP" ,
12341237long_options ,& option_index ))!= -1 )
12351238{
12361239switch (c )
@@ -1251,6 +1254,24 @@ main(int argc, char **argv)
12511254}
12521255break ;
12531256case 'x' :
1257+ if (includewal )
1258+ {
1259+ fprintf (stderr ,_ ("%s: cannot specify both --xlog and --xlog-method\n" ),
1260+ progname );
1261+ exit (1 );
1262+ }
1263+
1264+ includewal = true;
1265+ streamwal = false;
1266+ break ;
1267+ case 'X' :
1268+ if (includewal )
1269+ {
1270+ fprintf (stderr ,_ ("%s: cannot specify both --xlog and --xlog-method\n" ),
1271+ progname );
1272+ exit (1 );
1273+ }
1274+
12541275includewal = true;
12551276if (strcmp (optarg ,"f" )== 0 ||
12561277strcmp (optarg ,"fetch" )== 0 )
@@ -1260,7 +1281,7 @@ main(int argc, char **argv)
12601281streamwal = true;
12611282else
12621283{
1263- fprintf (stderr ,_ ("%s: invalid xlog option \"%s\", must be empty, \"fetch\", or \"stream\"\n" ),
1284+ fprintf (stderr ,_ ("%s: invalid xlog-method option \"%s\", must be empty, \"fetch\", or \"stream\"\n" ),
12641285progname ,optarg );
12651286exit (1 );
12661287}