mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-08 11:14:03 +08:00
Add xy_streql()
This commit is contained in:
parent
524a762c96
commit
f63b224b95
8
chsrc.c
8
chsrc.c
@ -629,7 +629,7 @@ main (int argc, char const *argv[])
|
|||||||
|
|
||||||
// 第一个参数
|
// 第一个参数
|
||||||
const char* target = NULL;
|
const char* target = NULL;
|
||||||
if (0==strcmp("-h",argv[1]) || 0==strcmp("--help",argv[1])) {
|
if (xy_streql("-h", argv[1]) || xy_streql("help", argv[1]) || xy_streql("--help", argv[1])) {
|
||||||
print_help(); return 0;
|
print_help(); return 0;
|
||||||
} else {
|
} else {
|
||||||
target = argv[1];
|
target = argv[1];
|
||||||
@ -655,7 +655,7 @@ main (int argc, char const *argv[])
|
|||||||
int k = 0;
|
int k = 0;
|
||||||
const char* alias = packager[k];
|
const char* alias = packager[k];
|
||||||
while (NULL!=alias) {
|
while (NULL!=alias) {
|
||||||
if (0==strcmp(target, alias)) {
|
if (xy_streql(target, alias)) {
|
||||||
// printf("matched: %s\n", alias);
|
// printf("matched: %s\n", alias);
|
||||||
matched = 1; break;
|
matched = 1; break;
|
||||||
}
|
}
|
||||||
@ -677,7 +677,7 @@ main (int argc, char const *argv[])
|
|||||||
const char* alias = system[k];
|
const char* alias = system[k];
|
||||||
while (NULL!=alias) {
|
while (NULL!=alias) {
|
||||||
// printf("%s matched: %s\n",target, alias);
|
// printf("%s matched: %s\n",target, alias);
|
||||||
if (0==strcmp(target, alias)) {
|
if (xy_streql(target, alias)) {
|
||||||
// printf("matched: %s\n", alias);
|
// printf("matched: %s\n", alias);
|
||||||
matched = 1; break;
|
matched = 1; break;
|
||||||
}
|
}
|
||||||
@ -699,7 +699,7 @@ main (int argc, char const *argv[])
|
|||||||
const char* alias = ware[k];
|
const char* alias = ware[k];
|
||||||
while (NULL!=alias) {
|
while (NULL!=alias) {
|
||||||
// printf("%s matched: %s\n",target, alias);
|
// printf("%s matched: %s\n",target, alias);
|
||||||
if (0==strcmp(target, alias)) {
|
if (xy_streql(target, alias)) {
|
||||||
// printf("matched: %s\n", alias);
|
// printf("matched: %s\n", alias);
|
||||||
matched = 1; break;
|
matched = 1; break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user