Skip to content

Commit cc9b857

Browse files
author
Mikachu2333
committed
only cuse ignore case in main.cpp
1 parent 310c2e8 commit cc9b857

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

src/chsrc-main.c

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* | BingChunMoLi <bingchunmoli@bingchunmoli.com>
3333
* |
3434
* Created On : <2023-08-28>
35-
* Last Modified : <2025-07-31>
35+
* Last Modified : <2025-08-07>
3636
*
3737
* chsrc: Change Source —— 全平台通用命令行换源工具
3838
* ------------------------------------------------------------*/
@@ -402,7 +402,7 @@ iterate_targets_ (const char ***array, size_t size, const char *input, const cha
402402
alias = target[k];
403403
while (NULL!=alias)
404404
{
405-
if (xy_streql (input, alias))
405+
if (xy_streql_ic (input, alias))
406406
{
407407
matched = 1; break;
408408
}
@@ -572,36 +572,36 @@ main (int argc, char const *argv[])
572572
{
573573
if (xy_str_start_with (argv[i], "-"))
574574
{
575-
if (xy_streql (argv[i], "-ipv6"))
575+
if (xy_streql_ic_ic (argv[i], "-ipv6"))
576576
{
577577
ProgMode.Ipv6Mode = true;
578578
}
579-
else if (xy_streql (argv[i], "-local"))
579+
else if (xy_streql_ic (argv[i], "-local"))
580580
{
581581
ProgMode.LocalMode = true;
582582
}
583-
else if (xy_streql (argv[i], "-en") || xy_streql (argv[i], "-english"))
583+
else if (xy_streql_ic (argv[i], "-en") || xy_streql_ic (argv[i], "-english"))
584584
{
585585
ProgMode.EnglishMode = true;
586586
}
587-
else if (xy_streql (argv[i], "-dry"))
587+
else if (xy_streql_ic (argv[i], "-dry"))
588588
{
589589
ProgMode.DryRunMode = true;
590590
}
591-
else if (xy_streql (argv[i], "-no-color") || xy_streql (argv[i], "-no-colour"))
591+
else if (xy_streql_ic (argv[i], "-no-color") || xy_streql (argv[i], "-no-colour"))
592592
{
593593
ProgMode.NoColorMode = true;
594594
xy_enable_color = false;
595595
}
596-
else if ( xy_streql (argv[i], "-h")
597-
|| xy_streql (argv[i], "-help")
598-
|| xy_streql (argv[i], "--help"))
596+
else if ( xy_streql_ic (argv[i], "-h")
597+
|| xy_streql_ic (argv[i], "-help")
598+
|| xy_streql_ic (argv[i], "--help"))
599599
{
600600
command = "help"; /* 交到下方处理 */
601601
}
602-
else if ( xy_streql (argv[i], "-v")
603-
|| xy_streql (command, "-version")
604-
|| xy_streql (command, "--version"))
602+
else if ( xy_streql_ic (argv[i], "-v")
603+
|| xy_streql_ic (command, "-version")
604+
|| xy_streql_ic (command, "--version"))
605605
{
606606
command = "version"; /* 交到下方处理 */
607607
}
@@ -628,31 +628,31 @@ main (int argc, char const *argv[])
628628
}
629629

630630
/* chsrc help */
631-
if ( xy_streql (command, "h")
632-
|| xy_streql (command, "-h")
633-
|| xy_streql (command, "help")
634-
|| xy_streql (command, "-help")
635-
|| xy_streql (command, "--help"))
631+
if ( xy_streql_ic (command, "h")
632+
|| xy_streql_ic (command, "-h")
633+
|| xy_streql_ic (command, "help")
634+
|| xy_streql_ic (command, "-help")
635+
|| xy_streql_ic (command, "--help"))
636636
{
637637
cli_print_help ();
638638
return Exit_OK;
639639
}
640640

641641
/* chsrc -v */
642-
else if ( xy_streql (command, "-v")
643-
|| xy_streql (command, "-version")
644-
|| xy_streql (command, "--version")
645-
|| xy_streql (command, "ver")
646-
|| xy_streql (command, "version"))
642+
else if ( xy_streql_ic (command, "-v")
643+
|| xy_streql_ic (command, "-version")
644+
|| xy_streql_ic (command, "--version")
645+
|| xy_streql_ic (command, "ver")
646+
|| xy_streql_ic (command, "version"))
647647
{
648648
cli_print_version ();
649649
return Exit_OK;
650650
}
651651

652652
/* chsrc list */
653-
else if ( xy_streql (command, "list")
654-
|| xy_streql (command, "l")
655-
|| xy_streql (command, "ls"))
653+
else if ( xy_streql_ic (command, "list")
654+
|| xy_streql_ic (command, "l")
655+
|| xy_streql_ic (command, "ls"))
656656
{
657657
if (argc < cli_arg_Target_pos)
658658
{
@@ -663,23 +663,23 @@ main (int argc, char const *argv[])
663663
else
664664
{
665665
target = argv[cli_arg_Target_pos];
666-
if (xy_streql (target, "mirrors") || xy_streql (target, "mirror"))
666+
if (xy_streql_ic (target, "mirrors") || xy_streql_ic (target, "mirror"))
667667
{
668668
cli_print_available_mirrors (); return Exit_OK;
669669
}
670-
else if (xy_streql (target, "targets") || xy_streql (target, "target"))
670+
else if (xy_streql_ic (target, "targets") || xy_streql_ic (target, "target"))
671671
{
672672
cli_print_supported_targets (); return Exit_OK;
673673
}
674-
else if (xy_streql (target, "os"))
674+
else if (xy_streql_ic (target, "os"))
675675
{
676676
cli_print_supported_os (); return Exit_OK;
677677
}
678-
else if (xy_streql (target, "lang") || xy_streql (target, "pl") || xy_streql (target, "language"))
678+
else if (xy_streql_ic (target, "lang") || xy_streql_ic (target, "pl") || xy_streql_ic (target, "language"))
679679
{
680680
cli_print_supported_pl(); return Exit_OK;
681681
}
682-
else if (xy_streql (target, "ware") || xy_streql (target, "software"))
682+
else if (xy_streql_ic (target, "ware") || xy_streql_ic (target, "software"))
683683
{
684684
cli_print_supported_wr (); return Exit_OK;
685685
}
@@ -694,12 +694,12 @@ main (int argc, char const *argv[])
694694
#define MSG_CN_USE_LIST_TARGETS "使用 chsrc list targets 查看所有支持的目标"
695695

696696
/* chsrc measure */
697-
else if ( xy_streql (command, "measure")
698-
|| xy_streql (command, "mea")
699-
|| xy_streql (command, "m")
700-
|| xy_streql (command, "cesu")
701-
|| xy_streql (command, "ce")
702-
|| xy_streql (command, "c"))
697+
else if ( xy_streql_ic (command, "measure")
698+
|| xy_streql_ic (command, "mea")
699+
|| xy_streql_ic (command, "m")
700+
|| xy_streql_ic (command, "cesu")
701+
|| xy_streql_ic (command, "ce")
702+
|| xy_streql_ic (command, "c"))
703703
{
704704
if (argc < cli_arg_Target_pos)
705705
{
@@ -717,8 +717,8 @@ main (int argc, char const *argv[])
717717

718718

719719
/* chsrc get */
720-
else if ( xy_streql (command, "get")
721-
|| xy_streql (command, "g"))
720+
else if ( xy_streql_ic (command, "get")
721+
|| xy_streql_ic (command, "g"))
722722
{
723723
if (argc < cli_arg_Target_pos)
724724
{
@@ -734,8 +734,8 @@ main (int argc, char const *argv[])
734734
}
735735

736736
/* chsrc set */
737-
else if ( xy_streql (command, "set")
738-
|| xy_streql (command, "s"))
737+
else if ( xy_streql_ic (command, "set")
738+
|| xy_streql_ic (command, "s"))
739739
{
740740
if (argc < cli_arg_Target_pos)
741741
{
@@ -758,9 +758,9 @@ main (int argc, char const *argv[])
758758
}
759759

760760
/* chsrc reset */
761-
else if ( xy_streql (command, "reset")
762-
|| xy_streql (command, "rest")
763-
|| xy_streql (command, "r"))
761+
else if ( xy_streql_ic (command, "reset")
762+
|| xy_streql_ic (command, "rest")
763+
|| xy_streql_ic (command, "r"))
764764
{
765765
if (argc < cli_arg_Target_pos)
766766
{
@@ -778,10 +778,10 @@ main (int argc, char const *argv[])
778778
}
779779

780780
/* chsrc issue */
781-
else if ( xy_streql (command, "issue")
782-
|| xy_streql (command, "issues")
783-
|| xy_streql (command, "isue")
784-
|| xy_streql (command, "i"))
781+
else if ( xy_streql_ic (command, "issue")
782+
|| xy_streql_ic (command, "issues")
783+
|| xy_streql_ic (command, "isue")
784+
|| xy_streql_ic (command, "i"))
785785
{
786786
cli_print_issues ();
787787
return Exit_OK;

0 commit comments

Comments
 (0)