Improve command line error handling

Per e.g. this complaint:

 https://groups.google.com/d/msg/repmgr/a-SMIQFGDBs/rgRH3p4ZPgYJ

Before:

    $ repmgr -f /etc/postgres/repmgr.conf cluster status

    repmgr: Replicator manager
    Try "repmgr --help" for more information.

after:

    $ repmgr -f /etc/postgres/repmgr.conf cluster status
    repmgr: Replication manager
    [ERROR] Unknown server command 'status'
    Try "repmgr --help" for more information.
This commit is contained in:
Ian Barwick
2015-03-03 11:13:37 +09:00
parent 3d3f082617
commit 6b1f55ff1b
2 changed files with 145 additions and 70 deletions

View File

@@ -95,4 +95,17 @@ typedef struct
#define T_RUNTIME_OPTIONS_INITIALIZER { "", "", "", "", "", "", "", DEFAULT_WAL_KEEP_SEGMENTS, false, false, false, false, false, false, "", "", 0, "", "" }
extern char repmgr_schema[MAXLEN];
typedef struct ErrorListCell
{
struct ErrorListCell *next;
char *error_message;
} ErrorListCell;
typedef struct ErrorList
{
ErrorListCell *head;
ErrorListCell *tail;
} ErrorList;
#endif