int usage(int retval, bool brief) {
  if (brief)
    ( retval ? std::cerr : std::cout ) << "Usage:\n"
"    GeodesicProj ( -z | -c | -g ) lat0 lon0 [ -r ] [ -e a f ] [ -w ] [ -p\n"
"    prec ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ]\n"
"    [ --input-file infile | --input-string instring ] [ --line-separator\n"
"    linesep ] [ --output-file outfile ]\n"
"\n"
"For full documentation type:\n"
"    GeodesicProj --help\n"
"or visit:\n"
"    https://geographiclib.sourceforge.io/1.51/GeodesicProj.1.html\n";
  else
    ( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
"       GeodesicProj -- perform projections based on geodesics\n"
"\n"
"SYNOPSIS\n"
"       GeodesicProj ( -z | -c | -g ) lat0 lon0 [ -r ] [ -e a f ] [ -w ] [ -p\n"
"       prec ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ]\n"
"       [ --input-file infile | --input-string instring ] [ --line-separator\n"
"       linesep ] [ --output-file outfile ]\n"
"\n"
"DESCRIPTION\n"
"       Perform projections based on geodesics.  Convert geodetic coordinates\n"
"       to either azimuthal equidistant, Cassini-Soldner, or gnomonic\n"
"       coordinates.  The center of the projection (lat0, lon0) is specified by\n"
"       either the -c option (for Cassini-Soldner), the -z option (for\n"
"       azimuthal equidistant), or the -g option (for gnomonic).  At least one\n"
"       of these options must be given (the last one given is used).\n"
"\n"
"       Geodetic coordinates are provided on standard input as a set of lines\n"
"       containing (blank separated) latitude and longitude (decimal degrees or\n"
"       degrees, minutes, seconds); for details on the allowed formats for\n"
"       latitude and longitude, see the \"GEOGRAPHIC COORDINATES\" section of\n"
"       GeoConvert(1).  For each set of geodetic coordinates, the corresponding\n"
"       projected coordinates x, y (meters) are printed on standard output\n"
"       together with the azimuth azi (degrees) and reciprocal scale rk.  For\n"
"       Cassini-Soldner, azi is the bearing of the easting direction and the\n"
"       scale in the easting direction is 1 and the scale in the northing\n"
"       direction is 1/rk.  For azimuthal equidistant and gnomonic, azi is the\n"
"       bearing of the radial direction and the scale in the azimuthal\n"
"       direction is 1/rk.  For azimuthal equidistant and gnomonic, the scales\n"
"       in the radial direction are 1 and 1/rk^2, respectively.\n"
"\n"
"OPTIONS\n"
"       -z lat0 lon0\n"
"           use the azimuthal equidistant projection centered at latitude =\n"
"           lat0, longitude = lon0.  The -w flag can be used to swap the\n"
"           default order of the 2 coordinates, provided that it appears before\n"
"           -z.\n"
"\n"
"       -c lat0 lon0\n"
"           use the Cassini-Soldner projection centered at latitude = lat0,\n"
"           longitude = lon0.  The -w flag can be used to swap the default\n"
"           order of the 2 coordinates, provided that it appears before -c.\n"
"\n"
"       -g lat0 lon0\n"
"           use the ellipsoidal gnomonic projection centered at latitude =\n"
"           lat0, longitude = lon0.  The -w flag can be used to swap the\n"
"           default order of the 2 coordinates, provided that it appears before\n"
"           -g.\n"
"\n"
"       -r  perform the reverse projection.  x and y are given on standard\n"
"           input and each line of standard output gives latitude, longitude,\n"
"           azi, and rk.\n"
"\n"
"       -e a f\n"
"           specify the ellipsoid via the equatorial radius, a and the\n"
"           flattening, f.  Setting f = 0 results in a sphere.  Specify f < 0\n"
"           for a prolate ellipsoid.  A simple fraction, e.g., 1/297, is\n"
"           allowed for f.  By default, the WGS84 ellipsoid is used, a =\n"
"           6378137 m, f = 1/298.257223563.\n"
"\n"
"       -w  toggle the longitude first flag (it starts off); if the flag is on,\n"
"           then on input and output, longitude precedes latitude (except that,\n"
"           on input, this can be overridden by a hemisphere designator, N, S,\n"
"           E, W).\n"
"\n"
"       -p prec\n"
"           set the output precision to prec (default 6).  prec is the number\n"
"           of digits after the decimal point for lengths (in meters).  For\n"
"           latitudes, longitudes, and azimuths (in degrees), the number of\n"
"           digits after the decimal point is prec + 5.  For the scale, the\n"
"           number of digits after the decimal point is prec + 6.\n"
"\n"
"       --comment-delimiter commentdelim\n"
"           set the comment delimiter to commentdelim (e.g., \"#\" or \"//\").  If\n"
"           set, the input lines will be scanned for this delimiter and, if\n"
"           found, the delimiter and the rest of the line will be removed prior\n"
"           to processing and subsequently appended to the output line\n"
"           (separated by a space).\n"
"\n"
"       --version\n"
"           print version and exit.\n"
"\n"
"       -h  print usage and exit.\n"
"\n"
"       --help\n"
"           print full documentation and exit.\n"
"\n"
"       --input-file infile\n"
"           read input from the file infile instead of from standard input; a\n"
"           file name of \"-\" stands for standard input.\n"
"\n"
"       --input-string instring\n"
"           read input from the string instring instead of from standard input.\n"
"           All occurrences of the line separator character (default is a\n"
"           semicolon) in instring are converted to newlines before the reading\n"
"           begins.\n"
"\n"
"       --line-separator linesep\n"
"           set the line separator character to linesep.  By default this is a\n"
"           semicolon.\n"
"\n"
"       --output-file outfile\n"
"           write output to the file outfile instead of to standard output; a\n"
"           file name of \"-\" stands for standard output.\n"
"\n"
"EXAMPLES\n"
"          echo 48.648 -2.007 | GeodesicProj -c 48.836 2.337\n"
"          => -319919 -11791 86.7 0.999\n"
"          echo -319919 -11791 | GeodesicProj -c 48.836 2.337 -r\n"
"          => 48.648 -2.007 86.7 0.999\n"
"\n"
"ERRORS\n"
"       An illegal line of input will print an error message to standard output\n"
"       beginning with \"ERROR:\" and causes GeodesicProj to return an exit code\n"
"       of 1.  However, an error does not cause GeodesicProj to terminate;\n"
"       following lines will be converted.\n"
"\n"
"SEE ALSO\n"
"       The ellipsoidal gnomonic projection is derived in Section 8 of C. F. F.\n"
"       Karney, Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); DOI\n"
"       <https://doi.org/10.1007/s00190-012-0578-z>; addenda:\n"
"       <https://geographiclib.sourceforge.io/geod-addenda.html>.\n"
"\n"
"AUTHOR\n"
"       GeodesicProj was written by Charles Karney.\n"
"\n"
"HISTORY\n"
"       GeodesicProj was added to GeographicLib,\n"
"       <https://geographiclib.sourceforge.io>, in 2009-08.  Prior to version\n"
"       1.9 it was called EquidistantTest.\n"
;
  return retval;
}
