Обсуждение: pg_dump --help
Hi,
and see:
$ pg_dump --help
/usr/lib/postgresql/bin/pg_dump: invalid option -- -
hmm ?
Prepare anyone long options for pg_dump, pg_passwd, pg_version ?
If not, I make it, current state is disgraceful.
Karel
PS. If I meet with any mazy M$-Win user I always tell him: "..in open-source software we have good practice, all
softwarehas nice face and open work with unknow software is easy..."
----------------------------------------------------------------------
Karel Zak <zakkr@zf.jcu.cz> http://home.zf.jcu.cz/~zakkr/
Docs: http://docs.linux.cz (big docs archive)
Kim Project: http://home.zf.jcu.cz/~zakkr/kim/ (process manager)
FTP: ftp://ftp2.zf.jcu.cz/users/zakkr/ (C/ncurses/PgSQL)
-----------------------------------------------------------------------
>
>
> Hi,
>
> and see:
>
> $ pg_dump --help
> /usr/lib/postgresql/bin/pg_dump: invalid option -- -
>
> hmm ?
>
> Prepare anyone long options for pg_dump, pg_passwd, pg_version ?
> If not, I make it, current state is disgraceful.
>
#$ pg_dump -h
pg_dump: option requires an argument -- h
usage: pg_dump [options] dbname -a dump out only the data, no schema -c
clean(drop) schema prior to create -d dump data as proper insert strings -D
dump data as inserts with attribute names -f filename script output filename
-h hostname server host name -n suppress most quotes around identifiers
-N enable most quotes around identifiers -o dump object id's (oids)
-p port server port number -s dump out only the schema, no data -t
table dump for this table only -u use password authentication -v
verbose -x do not dump ACL's (grant/revoke)
If dbname is not supplied, then the DATABASE environment variable value
is used.
-- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026
On Wed, 15 Dec 1999, Bruce Momjian wrote:
> > $ pg_dump --help
> > /usr/lib/postgresql/bin/pg_dump: invalid option -- -
> >
> > hmm ?
> >
> > Prepare anyone long options for pg_dump, pg_passwd, pg_version ?
> > If not, I make it, current state is disgraceful.
> >
>
>
> #$ pg_dump -h
> pg_dump: option requires an argument -- h
> usage: pg_dump [options] dbname
> -a dump out only the data, no schema
> -c clean(drop) schema prior to create
--cut--
$ mysqldump --help
mysqldump Ver 4.0 Distrib 3.21.31, for pc-linux-gnu (i586)
By Igor Romanenko & Monty & Jani. This software is in public Domain
This software comes with ABSOLUTELY NO WARRANTY
Dumping definition and data mysql database or table
Usage: mysqldump [OPTIONS] database [tables]
-#, --debug=... Output debug log. Often this is 'd:t:o,filename -?, --help Displays this help and
exits.-c, --compleat-insert Use complete insert statements.
.....etc.
I send patch with long options next week.....
Karel
On Wed, 15 Dec 1999, Karel Zak - Zakkr wrote: > $ pg_dump --help > /usr/lib/postgresql/bin/pg_dump: invalid option -- - > > hmm ? > > Prepare anyone long options for pg_dump, pg_passwd, pg_version ? > If not, I make it, current state is disgraceful. Only GNU (Linux) systems support long options. What you consider disgraceful is normal behavior on the majority of platforms. I put in long options into psql and into the wrapper scripts (under some protests). But I agree that we should if at all only provide them, not advertise them, since it's going to be a support nightmare. If you plan on doing this, please look there and use the same options whereever possible. I have been trying to establish some consistent options naming across client applications. Also check out how psql copes with systems where there are no long options available. Meanwhile I have been getting closer to resolving to scratch pg_dump and write a new one for 7.1, so whatever you do now might not live long. :( -- Peter Eisentraut Sernanders vaeg 10:115 peter_e@gmx.net 75262 Uppsala http://yi.org/peter-e/ Sweden
On Thu, 16 Dec 1999, Peter Eisentraut wrote:
> On Wed, 15 Dec 1999, Karel Zak - Zakkr wrote:
>
> > $ pg_dump --help
> > /usr/lib/postgresql/bin/pg_dump: invalid option -- -
> >
> > hmm ?
> >
> > Prepare anyone long options for pg_dump, pg_passwd, pg_version ?
> > If not, I make it, current state is disgraceful.
Hi,
> Only GNU (Linux) systems support long options. What you consider
> disgraceful is normal behavior on the majority of platforms.
Yes, I know this (it is not first program, which I hacking :-),
IMHO is good resolution (?) add getopt_long() to str/utils and use it
for non-GNU (non getopt_long) platforms, or not?
> I put in long options into psql and into the wrapper scripts (under some
> protests). But I agree that we should if at all only provide them, not
> advertise them, since it's going to be a support nightmare.
I saw/use your current psql (great!). Plan you add long option to
usage() output? If yes, will good make identical output format for
all pg_ routines (nice is example 'mc --help' styl).
> If you plan on doing this, please look there and use the same options
> whereever possible. I have been trying to establish some consistent
> options naming across client applications. Also check out how psql copes
> with systems where there are no long options available.
Yes, I agree and I use your options.
> Meanwhile I have been getting closer to resolving to scratch pg_dump and
> write a new one for 7.1, so whatever you do now might not live long. :(
Hmm.. :-(, but I not worry, it is only small work for me and you can use
this options (and code) for your 7.1 version.
Karel
> > #$ pg_dump -h > > pg_dump: option requires an argument -- h > > usage: pg_dump [options] dbname > > -a dump out only the data, no schema > > -c clean(drop) schema prior to create > > --cut-- > > $ mysqldump --help > mysqldump Ver 4.0 Distrib 3.21.31, for pc-linux-gnu (i586) > By Igor Romanenko & Monty & Jani. This software is in public Domain > This software comes with ABSOLUTELY NO WARRANTY > > Dumping definition and data mysql database or table > Usage: mysqldump [OPTIONS] database [tables] > > -#, --debug=... Output debug log. Often this is 'd:t:o,filename > -?, --help Displays this help and exits. > -c, --compleat-insert Use complete insert statements. > > .....etc. > > I send patch with long options next week..... > It must be portable. See src/bin/psql/startup.c for an example of a portable solution. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026