Document the -H and -l flags

Fixes #1042
This commit is contained in:
Rangi
2022-09-01 23:50:58 -04:00
committed by Eldred Habert
parent c01317e08d
commit 889302a9e2
6 changed files with 53 additions and 18 deletions

View File

@@ -126,7 +126,7 @@ static struct option const longopts[] = {
static void print_usage(void)
{
fputs(
"Usage: rgbasm [-EhLVvw] [-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 pad_value] [-r depth] [-W warning] <file>\n"
"Useful options:\n"
@@ -273,6 +273,7 @@ int main(int argc, char *argv[])
case 'V':
printf("rgbasm %s\n", get_package_version_string());
exit(0);
case 'v':
verbose = true;
break;
@@ -351,7 +352,7 @@ int main(int argc, char *argv[])
charmap_New("main", NULL);
// Init lexer and file stack, prodiving file info
// Init lexer and file stack, providing file info
lexer_Init();
fstk_Init(mainFileName, maxDepth);

View File

@@ -175,6 +175,13 @@ void opt_Parse(char *s)
case '!': // negates flag options that do not take an argument
switch (s[1]) {
case 'H':
if (s[2] == '\0')
opt_H(true);
else
error("Option '!H' does not take an argument\n");
break;
case 'h':
if (s[2] == '\0')
opt_h(true);
@@ -189,6 +196,13 @@ void opt_Parse(char *s)
error("Option '!L' does not take an argument\n");
break;
case 'l':
if (s[2] == '\0')
opt_l(true);
else
error("Option '!l' does not take an argument\n");
break;
default:
error("Unknown option '!%c'\n", s[1]);
break;