Hi,

Almost all client applications and extensions will show "Options" and
"Connection options" sections when running with help option (--help).
However, "oid2name" was different, there is only the Options section.
For example,

$ vacuumlo --help
    vacuumlo removes unreferenced large objects from databases.

    Usage:
      vacuumlo [OPTION]... DBNAME...

    Options:
      -l LIMIT       commit after removing each LIMIT large objects
      -n             don't remove large objects, just show what would be done
      -v             write a lot of progress messages
      -V, --version  output version information, then exit
      -?, --help     show this help, then exit

    Connection options:
      -h HOSTNAME    database server host or socket directory
      -p PORT        database server port
      -U USERNAME    user name to connect as
      -w             never prompt for password
      -W             force password prompt

$ oid2name --help
    oid2name helps examining the file structure used by PostgreSQL.

    Usage:
      oid2name [OPTION]...

    Options:
      -d DBNAME      database to connect to
      -f FILENODE    show info for table with given file node
      -H HOSTNAME    database server host or socket directory
      -i             show indexes and sequences too
      -o OID         show info for table with given OID
      -p PORT        database server port number
      -q             quiet (don't show headers)
      -s             show all tablespaces
      -S             show system objects too
      -t TABLE       show info for named table
      -U NAME        connect as specified database user
      -V, --version  output version information, then exit
      -x             extended (show additional columns)
      -?, --help     show this help, then exit

Above oid2name's "-d, -H, -p and -U" options are related to Connection
Options. So, it would be beter to write it in Connection options.
For consistency, attached patch divides the Options section of oid2name
into two sections, Options and Connection options.

Regards,
Tatsuro Yamada
NTT Open Source Software Center
diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c
index 63e360c4c5..157eebb3dd 100644
--- a/contrib/oid2name/oid2name.c
+++ b/contrib/oid2name/oid2name.c
@@ -176,23 +176,25 @@ help(const char *progname)
 		   "Usage:\n"
 		   "  %s [OPTION]...\n"
 		   "\nOptions:\n"
-		   "  -d DBNAME      database to connect to\n"
 		   "  -f FILENODE    show info for table with given file node\n"
-		   "  -H HOSTNAME    database server host or socket directory\n"
 		   "  -i             show indexes and sequences too\n"
 		   "  -o OID         show info for table with given OID\n"
-		   "  -p PORT        database server port number\n"
 		   "  -q             quiet (don't show headers)\n"
 		   "  -s             show all tablespaces\n"
 		   "  -S             show system objects too\n"
 		   "  -t TABLE       show info for named table\n"
-		   "  -U NAME        connect as specified database user\n"
 		   "  -V, --version  output version information, then exit\n"
 		   "  -x             extended (show additional columns)\n"
 		   "  -?, --help     show this help, then exit\n"
+		   "\nConnection options:\n"
+		   "  -d DBNAME      database to connect to\n"
+		   "  -H HOSTNAME    database server host or socket directory\n"
+		   "  -p PORT        database server port number\n"
+		   "  -U NAME        connect as specified database user\n"
 		   "\nThe default action is to show all database OIDs.\n\n"
 		   "Report bugs to <pgsql-b...@postgresql.org>.\n",
 		   progname, progname);
+
 }
 
 /*

Reply via email to