xbps-{bin,pkgdb}: use strcasecmp() to parse argv.

--HG--
extra : convert_revision : deb4624c3f6d031925f3fcea0461d68d37703f89
This commit is contained in:
Juan RP 2008-12-21 03:45:39 +01:00
parent e3a5509442
commit 716d9b9e7c
2 changed files with 9 additions and 9 deletions

View file

@ -160,7 +160,7 @@ main(int argc, char **argv)
if (argc < 2)
usage();
if (strcmp(argv[1], "repo-add") == 0) {
if (strcasecmp(argv[1], "repo-add") == 0) {
/* Adds a new repository to the pool. */
if (argc != 3)
usage();
@ -205,7 +205,7 @@ main(int argc, char **argv)
rinfo->total_pkgs);
free(rinfo);
} else if (strcmp(argv[1], "repo-list") == 0) {
} else if (strcasecmp(argv[1], "repo-list") == 0) {
/* Lists all repositories registered in pool. */
if (argc != 2)
usage();
@ -213,7 +213,7 @@ main(int argc, char **argv)
xbps_callback_array_iter_in_dict(getrepolist_dict(),
"repository-list", xbps_list_strings_in_array, NULL);
} else if (strcmp(argv[1], "repo-rm") == 0) {
} else if (strcasecmp(argv[1], "repo-rm") == 0) {
/* Remove a repository from the pool. */
if (argc != 3)
usage();
@ -232,7 +232,7 @@ main(int argc, char **argv)
exit(EINVAL);
}
} else if (strcmp(argv[1], "show") == 0) {
} else if (strcasecmp(argv[1], "show") == 0) {
/* Shows info about a binary package. */
if (argc != 3)
usage();

View file

@ -192,7 +192,7 @@ main(int argc, char **argv)
if (in_chroot_env != NULL)
in_chroot = true;
if (strcmp(argv[1], "register") == 0) {
if (strcasecmp(argv[1], "register") == 0) {
/* Registers a package into the database */
if (argc != 5)
usage();
@ -249,7 +249,7 @@ main(int argc, char **argv)
printf("%s=> %s-%s registered successfully.\n",
in_chroot ? "[chroot] " : "", argv[2], argv[3]);
} else if (strcmp(argv[1], "unregister") == 0) {
} else if (strcasecmp(argv[1], "unregister") == 0) {
/* Unregisters a package from the database */
if (argc != 4)
usage();
@ -260,7 +260,7 @@ main(int argc, char **argv)
printf("%s=> %s-%s unregistered successfully.\n",
in_chroot ? "[chroot] " : "", argv[2], argv[3]);
} else if (strcmp(argv[1], "list") == 0) {
} else if (strcasecmp(argv[1], "list") == 0) {
/* Lists packages currently registered in database */
if (argc != 2)
usage();
@ -270,7 +270,7 @@ main(int argc, char **argv)
"packages", xbps_list_pkgs_in_dict, NULL))
exit(EINVAL);
} else if (strcmp(argv[1], "version") == 0) {
} else if (strcasecmp(argv[1], "version") == 0) {
/* Prints version of an installed package */
if (argc != 3)
usage();
@ -284,7 +284,7 @@ main(int argc, char **argv)
exit(1);
printf("%s\n", version);
} else if (strcmp(argv[1], "sanitize-plist") == 0) {
} else if (strcasecmp(argv[1], "sanitize-plist") == 0) {
/* Sanitize a plist file (indent the file properly) */
if (argc != 3)
usage();