Add -I as an alias for -i in rgbasm (#1056)

Co-authored-by: Rangi <35663410+Rangi42@users.noreply.github.com>
This commit is contained in:
Eldred Habert
2022-09-26 09:42:30 +02:00
committed by GitHub
parent b1a241233e
commit 6502ed3919
4 changed files with 11 additions and 7 deletions

View File

@@ -87,7 +87,7 @@ static char *make_escape(char const *str)
}
// Short options
static const char *optstring = "b:D:Eg:Hhi:LlM:o:P:p:Q:r:VvW:w";
static const char *optstring = "b:D:Eg:Hhi:I:LlM:o:P:p:Q:r:VvW:w";
// Variables for the long-only options
static int depType; // Variants of `-M`
@@ -107,7 +107,7 @@ static struct option const longopts[] = {
{ "gfx-chars", required_argument, NULL, 'g' },
{ "nop-after-halt", no_argument, NULL, 'H' },
{ "halt-without-nop", no_argument, NULL, 'h' },
{ "include", required_argument, NULL, 'i' },
{ "include", required_argument, NULL, 'I' },
{ "preserve-ld", no_argument, NULL, 'L' },
{ "auto-ldh", no_argument, NULL, 'l' },
{ "dependfile", required_argument, NULL, 'M' },
@@ -129,7 +129,7 @@ static struct option const longopts[] = {
static void print_usage(void)
{
fputs(
"Usage: rgbasm [-EHhLlVvw] [-b chars] [-D name[=value]] [-g chars] [-i path]\n"
"Usage: rgbasm [-EHhLlVvw] [-b chars] [-D name[=value]] [-g chars] [-I path]\n"
" [-M depend_file] [-MG] [-MP] [-MT target_file] [-MQ target_file]\n"
" [-o out_file] [-P include_file] [-p pad_value] [-Q precision]\n"
" [-r depth] [-W warning] <file>\n"
@@ -220,6 +220,10 @@ int main(int argc, char *argv[])
haltnop = false;
break;
// `-i` was the only short option for `--include` until `-I` was
// introduced to better match the `-I dir` option of gcc and clang.
// `-i` is now undocumented but still supported for now.
case 'I':
case 'i':
fstk_AddIncludePath(musl_optarg);
break;