xbps-{bin,repo}: redirect error messages to stderr.

This commit is contained in:
Juan RP 2012-02-25 10:30:15 +01:00
parent 001947d9bb
commit 8c6b335ca8
2 changed files with 5 additions and 5 deletions

View File

@ -240,8 +240,8 @@ main(int argc, char **argv)
else if (strcmp(argv[1], "half-removed") == 0) else if (strcmp(argv[1], "half-removed") == 0)
lpc.state = XBPS_PKG_STATE_HALF_REMOVED; lpc.state = XBPS_PKG_STATE_HALF_REMOVED;
else { else {
fprintf(stderr, xbps_error_printf(
"E: invalid state `%s'. Accepted values: " "invalid state `%s'. Accepted values: "
"half-removed, unpacked, half-unpacked, " "half-removed, unpacked, half-unpacked, "
"installed [default]\n", argv[1]); "installed [default]\n", argv[1]);
rv = -1; rv = -1;

View File

@ -199,7 +199,7 @@ main(int argc, char **argv)
rv = show_pkg_info_from_repolist(argv[1], option); rv = show_pkg_info_from_repolist(argv[1], option);
if (rv == ENOENT) { if (rv == ENOENT) {
printf("Unable to locate package " xbps_error_printf("Unable to locate package "
"`%s' in repository pool.\n", argv[1]); "`%s' in repository pool.\n", argv[1]);
} else if (rv == ENOTSUP) { } else if (rv == ENOTSUP) {
xbps_error_printf("xbps-repo: no repositories " xbps_error_printf("xbps-repo: no repositories "
@ -215,7 +215,7 @@ main(int argc, char **argv)
rv = show_pkg_deps_from_repolist(argv[1]); rv = show_pkg_deps_from_repolist(argv[1]);
if (rv == ENOENT) { if (rv == ENOENT) {
printf("Unable to locate package " xbps_error_printf("Unable to locate package "
"`%s' in repository pool.\n", argv[1]); "`%s' in repository pool.\n", argv[1]);
} else if (rv == ENOTSUP) { } else if (rv == ENOTSUP) {
xbps_error_printf("xbps-repo: no repositories " xbps_error_printf("xbps-repo: no repositories "
@ -236,7 +236,7 @@ main(int argc, char **argv)
xbps_error_printf("xbps-repo: no repositories " xbps_error_printf("xbps-repo: no repositories "
"currently registered!\n"); "currently registered!\n");
} else if (errno == ENOENT) { } else if (errno == ENOENT) {
printf("Unable to locate package `%s' " xbps_error_printf("Unable to locate package `%s' "
"in repository pool.\n", argv[1]); "in repository pool.\n", argv[1]);
} else { } else {
xbps_error_printf("xbps-repo: unexpected " xbps_error_printf("xbps-repo: unexpected "