From: | Oliver Elphick <olly(at)lfix(dot)co(dot)uk> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | pg_ctl - tighten command parameter checking |
Date: | 2002-02-16 11:29:11 |
Message-ID: | 1013858952.4369.92.camel@linda |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
The attached patch improves the command parameter checking of pg_ctl.
At present, there is nothing to check that the parameter given with a
parameter-taking option is actually valid. For example, -l can be given
without a following logfile name; on a strict POSIX shell such as ash,
you will get a subsequent failure because of too many shifts, but bash
will let it pass without showing any error. The patch checks that each
parameter is not empty and is not another option.
A consequence of this change is that no command-line parameter can begin
with "-" (except for the parameter to -o); this seems a reasonable
restriction.
For consistency and clarity, I have also changed every occurrence of
"shift ... var=$1" to "var=$2 ... shift".
--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
"But as many as received him, to them gave he power to
become the sons of God, even to them that believe on
his name" John 1:12
Attachment | Content-Type | Size |
---|---|---|
pg_ctl.patch | text/x-patch | 2.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Alejandro Rivadeneira | 2002-02-16 16:33:09 | PostgreSQL Spanish manuals , files & links |
Previous Message | Per Erik Ronne | 2002-02-16 06:49:04 | Re: pgbash-2.4 released |