main: add support for --prefix-variable (ref #103)

feature/tap-sh
William Pitcock 2017-01-19 19:21:46 -06:00
parent ced4f00363
commit bd6be71115
1 changed files with 6 additions and 0 deletions

6
main.c
View File

@ -569,6 +569,8 @@ usage(void)
printf(" walking the dependency graph\n"); printf(" walking the dependency graph\n");
printf(" --log-file=filename write an audit log to a specified file\n"); printf(" --log-file=filename write an audit log to a specified file\n");
printf(" --with-path=path adds a directory to the search path\n"); printf(" --with-path=path adds a directory to the search path\n");
printf(" --prefix-variable=varname sets the name of the variable that pkgconf considers\n");
printf(" to be the package prefix\n");
printf("\nchecking specific pkg-config database entries:\n\n"); printf("\nchecking specific pkg-config database entries:\n\n");
@ -675,6 +677,7 @@ main(int argc, char *argv[])
{ "log-file", required_argument, NULL, 40 }, { "log-file", required_argument, NULL, 40 },
{ "path", no_argument, &want_flags, PKG_PATH }, { "path", no_argument, &want_flags, PKG_PATH },
{ "with-path", required_argument, NULL, 42 }, { "with-path", required_argument, NULL, 42 },
{ "prefix-variable", required_argument, NULL, 43 },
{ NULL, 0, NULL, 0 } { NULL, 0, NULL, 0 }
}; };
@ -711,6 +714,9 @@ main(int argc, char *argv[])
case 42: case 42:
pkgconf_path_add(pkg_optarg, &pkg_client.dir_list, true); pkgconf_path_add(pkg_optarg, &pkg_client.dir_list, true);
break; break;
case 43:
pkgconf_client_set_prefix_varname(&pkg_client, pkg_optarg);
break;
case '?': case '?':
case ':': case ':':
return EXIT_FAILURE; return EXIT_FAILURE;