|
4 | 4 | * |
5 | 5 | * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group |
6 | 6 | * |
7 | | - * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.85 2007/10/31 10:55:25 petere Exp $ |
| 7 | + * $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.86 2007/11/10 21:48:51 momjian Exp $ |
8 | 8 | * |
9 | 9 | *------------------------------------------------------------------------- |
10 | 10 | */ |
@@ -1465,21 +1465,22 @@ do_help(void) |
1465 | 1465 | printf(_("%s is a utility to start, stop, restart, reload configuration files,\n" |
1466 | 1466 | "report the status of a PostgreSQL server, or signal a PostgreSQL process.\n\n"),progname); |
1467 | 1467 | printf(_("Usage:\n")); |
1468 | | -printf(_(" %s start [-w] [-D DATADIR] [-s] [-l FILENAME] [-o \"OPTIONS\"]\n"),progname); |
| 1468 | +printf(_(" %s start [-w] [-t secs] [-D DATADIR] [-s] [-l FILENAME] [-o \"OPTIONS\"]\n"),progname); |
1469 | 1469 | printf(_(" %s stop [-W] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]\n"),progname); |
1470 | | -printf(_(" %s restart [-w] [-D DATADIR] [-s] [-m SHUTDOWN-MODE] [-o \"OPTIONS\"]\n"),progname); |
| 1470 | +printf(_(" %s restart [-w] [-t secs] [-D DATADIR] [-s] [-m SHUTDOWN-MODE]\n [-o \"OPTIONS\"]\n"),progname); |
1471 | 1471 | printf(_(" %s reload [-D DATADIR] [-s]\n"),progname); |
1472 | 1472 | printf(_(" %s status [-D DATADIR]\n"),progname); |
1473 | 1473 | printf(_(" %s kill SIGNALNAME PID\n"),progname); |
1474 | 1474 | #if defined(WIN32)|| defined(__CYGWIN__) |
1475 | 1475 | printf(_(" %s register [-N SERVICENAME] [-U USERNAME] [-P PASSWORD] [-D DATADIR]\n" |
1476 | | -" [-w] [-o \"OPTIONS\"]\n"),progname); |
| 1476 | +" [-w] [-t timeout] [-o \"OPTIONS\"]\n"),progname); |
1477 | 1477 | printf(_(" %s unregister [-N SERVICENAME]\n"),progname); |
1478 | 1478 | #endif |
1479 | 1479 |
|
1480 | 1480 | printf(_("\nCommon options:\n")); |
1481 | 1481 | printf(_(" -D, --pgdata DATADIR location of the database storage area\n")); |
1482 | 1482 | printf(_(" -s, --silent only print errors, no informational messages\n")); |
| 1483 | +printf(_(" -t secs seconds to wait when using -w option\n")); |
1483 | 1484 | printf(_(" -w wait until operation completes\n")); |
1484 | 1485 | printf(_(" -W do not wait until operation completes\n")); |
1485 | 1486 | printf(_(" --help show this help, then exit\n")); |
@@ -1592,6 +1593,7 @@ main(int argc, char **argv) |
1592 | 1593 | {"mode",required_argument,NULL,'m'}, |
1593 | 1594 | {"pgdata",required_argument,NULL,'D'}, |
1594 | 1595 | {"silent",no_argument,NULL,'s'}, |
| 1596 | +{"timeout",required_argument,NULL,'t'}, |
1595 | 1597 | {"core-files",no_argument,NULL,'c'}, |
1596 | 1598 | {NULL,0,NULL,0} |
1597 | 1599 | }; |
@@ -1657,7 +1659,7 @@ main(int argc, char **argv) |
1657 | 1659 | /* process command-line options */ |
1658 | 1660 | while (optind<argc) |
1659 | 1661 | { |
1660 | | -while ((c=getopt_long(argc,argv,"cD:l:m:N:o:p:P:sU:wW",long_options,&option_index))!=-1) |
| 1662 | +while ((c=getopt_long(argc,argv,"cD:l:m:N:o:p:P:st:U:wW",long_options,&option_index))!=-1) |
1661 | 1663 | { |
1662 | 1664 | switch (c) |
1663 | 1665 | { |
@@ -1704,6 +1706,9 @@ main(int argc, char **argv) |
1704 | 1706 | case's': |
1705 | 1707 | silent_mode= true; |
1706 | 1708 | break; |
| 1709 | +case't': |
| 1710 | +wait_seconds=atoi(optarg); |
| 1711 | +break; |
1707 | 1712 | case'U': |
1708 | 1713 | if (strchr(optarg,'\\')) |
1709 | 1714 | register_username=xstrdup(optarg); |
|