Ticket #2359: osm2pgsql.diff

File osm2pgsql.diff, 2.4 KB (added by aubreyholland@…, 5 years ago)

A diff that adds the requested functionality

  • osm2pgsql.c

     
    493493    fprintf(stderr, "   -C|--cache\t\tOnly for slim mode: Use upto this many MB for caching nodes\n"); 
    494494    fprintf(stderr, "             \t\tDefault is 800\n"); 
    495495    fprintf(stderr, "   -U|--username\tPostgresql user name.\n"); 
    496     fprintf(stderr, "   -W|--password\tForce password prompt.\n"); 
     496    fprintf(stderr, "   -W|--password\tPostgresql password.\n"); 
     497    fprintf(stderr, "   -x|--prompt\tForce password prompt.\n"); 
    497498    fprintf(stderr, "   -H|--host\t\tDatabase server hostname or socket location.\n"); 
    498499    fprintf(stderr, "   -P|--port\t\tDatabase server port.\n"); 
    499500    fprintf(stderr, "   -e|--expire-tiles [min_zoom-]max_zoom\tCreate a tile expiry list.\n"); 
     
    629630            {"utf8-sanitize", 0, 0, 'u'}, 
    630631            {"cache",    1, 0, 'C'}, 
    631632            {"username", 1, 0, 'U'}, 
    632             {"password", 0, 0, 'W'}, 
     633            {"password", 1, 0, 'W'}, 
     634            {"prompt",   0, 0, 'x'}, 
    633635            {"host",     1, 0, 'H'}, 
    634636            {"port",     1, 0, 'P'}, 
    635637            {"help",     0, 0, 'h'}, 
     
    640642            {0, 0, 0, 0} 
    641643        }; 
    642644 
    643         c = getopt_long (argc, argv, "ab:cd:hlmMp:suvU:WH:P:E:C:S:e:o:O:", long_options, &option_index); 
     645        c = getopt_long (argc, argv, "ab:cd:hlmMp:suvU:W:H:xP:E:C:S:e:o:O:", long_options, &option_index); 
    644646        if (c == -1) 
    645647            break; 
    646648 
     
    659661            case 'd': db=optarg;  break; 
    660662            case 'C': cache = atoi(optarg); break; 
    661663            case 'U': username=optarg; break; 
    662             case 'W': pass_prompt=1; break; 
     664            case 'W': password=optarg; break; 
     665            case 'x': pass_prompt=1; break; 
    663666            case 'H': host=optarg; break; 
    664667            case 'P': port=optarg; break; 
    665668            case 'S': style=optarg; break; 
     
    693696        fprintf(stderr, "Error: --append and --create options can not be used at the same time!\n"); 
    694697        exit(EXIT_FAILURE); 
    695698    } 
     699     
     700    if (password && pass_prompt) { 
     701        fprintf(stderr, "Error: --password and --prompt options can not be used at the same time!\n"); 
     702        exit(EXIT_FAILURE); 
     703    } 
    696704 
    697705    if ((expire_tiles_zoom >= 0) && (projection != PROJ_SPHERE_MERC)) { 
    698706        fprintf(stderr, "Error: --expire-tiles can only be used with spherical mercator projection!\n");