osm2pgsql should accept a password as an argument
|Reported by:||aubreyholland@…||Owned by:||jburgess777@…|
osm2pgsql takes arguments for all of the necessary information to connect to the database except for the password. Because the only option it provides for the password is for it to produce a prompt, this means that osm2pgsql can't be called through scripts, cron jobs, etc. without human intervention in cases where a password is required. There are other options for providing the password (the pgpass file, for example), but none of them seem as clean as simply providing the password to the program as other apps like osmosis allow.
I am attaching a diff that adds this feature. It changes the --password (-W) argument to take a password as a parameter and adds another argument, --prompt (-x) that does what --password used to do. I wasn't thrilled about changing the usage of the existing argument, but that seems like what --password really *should* do.