mirror of
https://github.com/RubyMetric/chsrc.git
synced 2025-01-22 17:44:00 +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;
|
||||
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;
|
||||
} else {
|
||||
target = argv[1];
|
||||
|
@ -655,7 +655,7 @@ main (int argc, char const *argv[])
|
|||
int k = 0;
|
||||
const char* alias = packager[k];
|
||||
while (NULL!=alias) {
|
||||
if (0==strcmp(target, alias)) {
|
||||
if (xy_streql(target, alias)) {
|
||||
// printf("matched: %s\n", alias);
|
||||
matched = 1; break;
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ main (int argc, char const *argv[])
|
|||
const char* alias = system[k];
|
||||
while (NULL!=alias) {
|
||||
// printf("%s matched: %s\n",target, alias);
|
||||
if (0==strcmp(target, alias)) {
|
||||
if (xy_streql(target, alias)) {
|
||||
// printf("matched: %s\n", alias);
|
||||
matched = 1; break;
|
||||
}
|
||||
|
@ -699,7 +699,7 @@ main (int argc, char const *argv[])
|
|||
const char* alias = ware[k];
|
||||
while (NULL!=alias) {
|
||||
// printf("%s matched: %s\n",target, alias);
|
||||
if (0==strcmp(target, alias)) {
|
||||
if (xy_streql(target, alias)) {
|
||||
// printf("matched: %s\n", alias);
|
||||
matched = 1; break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user