@@ -68,6 +68,8 @@ usage(void)
6868printf (_ (" %s [OPTION]...\n" ),progname );
6969printf (_ ("\nOptions:\n" ));
7070printf (_ (" -f, --file=FILE receive log into this file. - for stdout\n" ));
71+ printf (_ (" -F --fsync-interval=SECS\n"
72+ " frequency of syncs to the output file (default: %d)\n" ), (fsync_interval /1000 ));
7173printf (_ (" -n, --no-loop do not loop on connection lost\n" ));
7274printf (_ (" -v, --verbose output verbose messages\n" ));
7375printf (_ (" -V, --version output version information, then exit\n" ));
@@ -80,16 +82,14 @@ usage(void)
8082printf (_ (" -w, --no-password never prompt for password\n" ));
8183printf (_ (" -W, --password force password prompt (should happen automatically)\n" ));
8284printf (_ ("\nReplication options:\n" ));
83- printf (_ (" -F --fsync-interval=SECS\n"
84- " frequency of syncs to the output file (default: %d)\n" ), (fsync_interval /1000 ));
85+ printf (_ (" -I, --startpos=PTR where in an existing slot should the streaming start\n" ));
8586printf (_ (" -o, --option=NAME[=VALUE]\n"
8687" specify option NAME with optional value VALUE, to be passed\n"
8788" to the output plugin\n" ));
8889printf (_ (" -P, --plugin=PLUGIN use output plugin PLUGIN (default: %s)\n" ),plugin );
8990printf (_ (" -s, --status-interval=SECS\n"
9091" time between status packets sent to server (default: %d)\n" ), (standby_message_timeout /1000 ));
9192printf (_ (" -S, --slot=SLOT use existing replication slot SLOT instead of starting a new one\n" ));
92- printf (_ (" -I, --startpos=PTR where in an existing slot should the streaming start\n" ));
9393printf (_ ("\nAction to be performed:\n" ));
9494printf (_ (" --create create a new replication slot (for the slotname see --slot)\n" ));
9595printf (_ (" --start start streaming in a replication slot (for the slotname see --slot)\n" ));
@@ -600,6 +600,7 @@ main(int argc, char **argv)
600600static struct option long_options []= {
601601/* general options */
602602{"file" ,required_argument ,NULL ,'f' },
603+ {"fsync-interval" ,required_argument ,NULL ,'F' },
603604{"no-loop" ,no_argument ,NULL ,'n' },
604605{"verbose" ,no_argument ,NULL ,'v' },
605606{"version" ,no_argument ,NULL ,'V' },
@@ -612,12 +613,11 @@ main(int argc, char **argv)
612613{"no-password" ,no_argument ,NULL ,'w' },
613614{"password" ,no_argument ,NULL ,'W' },
614615/* replication options */
616+ {"startpos" ,required_argument ,NULL ,'I' },
615617{"option" ,required_argument ,NULL ,'o' },
616618{"plugin" ,required_argument ,NULL ,'P' },
617619{"status-interval" ,required_argument ,NULL ,'s' },
618- {"fsync-interval" ,required_argument ,NULL ,'F' },
619620{"slot" ,required_argument ,NULL ,'S' },
620- {"startpos" ,required_argument ,NULL ,'I' },
621621/* action */
622622{"create" ,no_argument ,NULL ,1 },
623623{"start" ,no_argument ,NULL ,2 },
@@ -647,7 +647,7 @@ main(int argc, char **argv)
647647}
648648}
649649
650- while ((c = getopt_long (argc ,argv ,"f:F:nvd:h:o: p:U:wWP :s:S:" ,
650+ while ((c = getopt_long (argc ,argv ,"f:F:nvd:h:p:U:wWI:o:P :s:S:" ,
651651long_options ,& option_index ))!= -1 )
652652{
653653switch (c )
@@ -656,6 +656,15 @@ main(int argc, char **argv)
656656case 'f' :
657657outfile = pg_strdup (optarg );
658658break ;
659+ case 'F' :
660+ fsync_interval = atoi (optarg )* 1000 ;
661+ if (fsync_interval < 0 )
662+ {
663+ fprintf (stderr ,_ ("%s: invalid fsync interval \"%s\"\n" ),
664+ progname ,optarg );
665+ exit (1 );
666+ }
667+ break ;
659668case 'n' :
660669noloop = 1 ;
661670break ;
@@ -688,6 +697,16 @@ main(int argc, char **argv)
688697dbgetpassword = 1 ;
689698break ;
690699/* replication options */
700+ case 'I' :
701+ if (sscanf (optarg ,"%X/%X" ,& hi ,& lo )!= 2 )
702+ {
703+ fprintf (stderr ,
704+ _ ("%s: could not parse start position \"%s\"\n" ),
705+ progname ,optarg );
706+ exit (1 );
707+ }
708+ startpos = ((uint64 )hi ) <<32 |lo ;
709+ break ;
691710case 'o' :
692711{
693712char * data = pg_strdup (optarg );
@@ -720,28 +739,9 @@ main(int argc, char **argv)
720739exit (1 );
721740}
722741break ;
723- case 'F' :
724- fsync_interval = atoi (optarg )* 1000 ;
725- if (fsync_interval < 0 )
726- {
727- fprintf (stderr ,_ ("%s: invalid fsync interval \"%s\"\n" ),
728- progname ,optarg );
729- exit (1 );
730- }
731- break ;
732742case 'S' :
733743replication_slot = pg_strdup (optarg );
734744break ;
735- case 'I' :
736- if (sscanf (optarg ,"%X/%X" ,& hi ,& lo )!= 2 )
737- {
738- fprintf (stderr ,
739- _ ("%s: could not parse start position \"%s\"\n" ),
740- progname ,optarg );
741- exit (1 );
742- }
743- startpos = ((uint64 )hi ) <<32 |lo ;
744- break ;
745745/* action */
746746case 1 :
747747do_create_slot = true;