More consistent man page descriptions for CLI options

This commit is contained in:
Rangi
2025-10-22 14:48:24 -04:00
parent 7654c6e27a
commit a0bb830679
4 changed files with 207 additions and 55 deletions

View File

@@ -36,14 +36,14 @@ The
program creates an RGB object file from an assembly source file. program creates an RGB object file from an assembly source file.
The object file format is documented in The object file format is documented in
.Xr rgbds 5 . .Xr rgbds 5 .
.Pp .Sh ARGUMENTS
The input .Nm
.Ar asmfile accepts the usual short and long options, such as
can be a path to a file, or .Fl V
.Cm \- and
to read from standard input. .Fl -version .
.Pp Options later in the command line override those set earlier, except for when duplicate options are considered an error.
Note that options can be abbreviated as long as the abbreviation is unambiguous: Options can be abbreviated as long as the abbreviation is unambiguous:
.Fl \-verb .Fl \-verb
is is
.Fl \-verbose , .Fl \-verbose ,
@@ -51,7 +51,52 @@ but
.Fl \-ver .Fl \-ver
is invalid because it could also be is invalid because it could also be
.Fl \-version . .Fl \-version .
The arguments are as follows: .Pp
Unless otherwise noted, passing
.Ql -
(a single dash) as a file name makes
.Nm
use standard input (for input files) or standard output (for output files).
To suppress this behavior, and open a file in the current directory actually called
.Ql - ,
pass
.Ql ./-
instead.
Using standard input or output for more than one file in a single command may produce unexpected results.
.Pp
.Nm
accepts decimal, hexadecimal, octal, and binary for numeric option arguments.
Decimal numbers are written as usual; hexadecimal numbers must be prefixed with either
.Ql $
or
.Ql 0x ;
octal numbers must be prefixed with either
.Ql &
or
.Ql 0o ;
and binary numbers must be prefixed with either
.Ql %
or
.Ql 0b .
(The prefixes
.Ql $
and
.Ql &
will likely need escaping or quoting to avoid being interpreted by the shell.)
Leading zeros (after the base prefix, if any) are accepted, and letters are not case-sensitive.
For example, all of these are equivalent:
.Ql 42 ,
.Ql 042 ,
.Ql 0x2A ,
.Ql 0X2A ,
.Ql 0x2a ,
.Ql &52 ,
.Ql 0o52 ,
.Ql 0O052 ,
.Ql 0b00101010 ,
.Ql 0B101010 .
.Pp
The following options are accepted:
.Bl -tag -width Ds .Bl -tag -width Ds
.It Fl B Ar param , Fl \-backtrace Ar param .It Fl B Ar param , Fl \-backtrace Ar param
Configures how location backtraces are printed if warnings or errors occur. Configures how location backtraces are printed if warnings or errors occur.

View File

@@ -39,23 +39,67 @@ Developers are advised to fill those fields with 0x00 bytes in their source code
.Nm , .Nm ,
and to have already populated whichever fields they don't specify using and to have already populated whichever fields they don't specify using
.Nm . .Nm .
.Pp .Sh ARGUMENTS
The input .Nm
.Ar file accepts the usual short and long options, such as
can be a path to a file, or .Fl V
.Cm \- and
to read from standard input. .Fl -version .
.Pp Options later in the command line override those set earlier, except for when duplicate options are considered an error.
Note that options can be abbreviated as long as the abbreviation is unambiguous: Options can be abbreviated as long as the abbreviation is unambiguous:
.Fl \-verb
is
.Fl \-verbose ,
but
.Fl \-ver .Fl \-ver
is
.Fl \-version ,
but
.Fl \-v
is invalid because it could also be is invalid because it could also be
.Fl \-version . .Fl \-validate .
Options later in the command line override those set earlier. .Pp
Accepted options are as follows: Unless otherwise noted, passing
.Ql -
(a single dash) as a file name makes
.Nm
use standard input (for input files) or standard output (for output files).
To suppress this behavior, and open a file in the current directory actually called
.Ql - ,
pass
.Ql ./-
instead.
Using standard input or output for more than one file in a single command may produce unexpected results.
.Pp
.Nm
accepts decimal, hexadecimal, octal, and binary for numeric option arguments.
Decimal numbers are written as usual; hexadecimal numbers must be prefixed with either
.Ql $
or
.Ql 0x ;
octal numbers must be prefixed with either
.Ql &
or
.Ql 0o ;
and binary numbers must be prefixed with either
.Ql %
or
.Ql 0b .
(The prefixes
.Ql $
and
.Ql &
will likely need escaping or quoting to avoid being interpreted by the shell.)
Leading zeros (after the base prefix, if any) are accepted, and letters are not case-sensitive.
For example, all of these are equivalent:
.Ql 42 ,
.Ql 042 ,
.Ql 0x2A ,
.Ql 0X2A ,
.Ql 0x2a ,
.Ql &52 ,
.Ql 0o52 ,
.Ql 0O052 ,
.Ql 0b00101010 ,
.Ql 0B101010 .
.Pp
The following options are accepted:
.Bl -tag -width Ds .Bl -tag -width Ds
.It Fl C , Fl \-color-only .It Fl C , Fl \-color-only
Set the Game Boy Color\(enonly flag Set the Game Boy Color\(enonly flag

View File

@@ -43,7 +43,13 @@ is to divide the input PNG into 8\[tmu]8 pixel
convert each of those squares into 1bpp or 2bpp tile data, and save all of the tile data in a file. convert each of those squares into 1bpp or 2bpp tile data, and save all of the tile data in a file.
It also has options to generate a tile map, attribute map, and/or palette set as well; more on that and how the conversion process can be tweaked below. It also has options to generate a tile map, attribute map, and/or palette set as well; more on that and how the conversion process can be tweaked below.
.Sh ARGUMENTS .Sh ARGUMENTS
Note that options can be abbreviated as long as the abbreviation is unambiguous: .Nm
accepts the usual short and long options, such as
.Fl V
and
.Fl -version .
Options later in the command line override those set earlier, except for when duplicate options are considered an error.
Options can be abbreviated as long as the abbreviation is unambiguous:
.Fl \-verb .Fl \-verb
is is
.Fl \-verbose , .Fl \-verbose ,
@@ -52,26 +58,6 @@ but
is invalid because it could also be is invalid because it could also be
.Fl \-version . .Fl \-version .
.Pp .Pp
.Nm
accepts decimal, binary, and hexadecimal numbers in option arguments.
Decimal numbers are written as usual; binary numbers must be prefixed with either
.Ql %
or
.Ql 0b ,
and hexadecimal numbers must be prefixed with either
.Ql $
(which will likely need escaping or quoting to avoid being interpreted by the shell), or
.Ql 0x .
Leading zeros (after the base prefix, if any) are accepted, and letters are not case-sensitive.
All of these are equivalent:
.Ql 42 ,
.Ql 042 ,
.Ql 0b00101010 ,
.Ql 0B101010 ,
.Ql 0x2A ,
.Ql 0X2A ,
.Ql 0x2a .
.Pp
Unless otherwise noted, passing Unless otherwise noted, passing
.Ql - .Ql -
(a single dash) as a file name makes (a single dash) as a file name makes
@@ -82,7 +68,39 @@ To suppress this behavior, and open a file in the current directory actually cal
pass pass
.Ql ./- .Ql ./-
instead. instead.
Using standard input or output more than once in a single command will likely produce unexpected results. Using standard input or output for more than one file in a single command may produce unexpected results.
.Pp
.Nm
accepts decimal, hexadecimal, octal, and binary for numeric option arguments.
Decimal numbers are written as usual; hexadecimal numbers must be prefixed with either
.Ql $
or
.Ql 0x ;
octal numbers must be prefixed with either
.Ql &
or
.Ql 0o ;
and binary numbers must be prefixed with either
.Ql %
or
.Ql 0b .
(The prefixes
.Ql $
and
.Ql &
will likely need escaping or quoting to avoid being interpreted by the shell.)
Leading zeros (after the base prefix, if any) are accepted, and letters are not case-sensitive.
For example, all of these are equivalent:
.Ql 42 ,
.Ql 042 ,
.Ql 0x2A ,
.Ql 0X2A ,
.Ql 0x2a ,
.Ql &52 ,
.Ql 0o52 ,
.Ql 0O052 ,
.Ql 0b00101010 ,
.Ql 0B101010 .
.Pp .Pp
The following options are accepted: The following options are accepted:
.Bl -tag -width Ds .Bl -tag -width Ds

View File

@@ -48,14 +48,14 @@ Also, if your ROM is designed for a monochrome Game Boy, you can make sure that
option, which implies option, which implies
.Fl w .Fl w
but also prohibits the use of banked VRAM. but also prohibits the use of banked VRAM.
.Pp .Sh ARGUMENTS
The input .Nm
.Ar file accepts the usual short and long options, such as
can be a path to a file, or .Fl V
.Cm \- and
to read from standard input. .Fl -version .
.Pp Options later in the command line override those set earlier, except for when duplicate options are considered an error.
Note that options can be abbreviated as long as the abbreviation is unambiguous: Options can be abbreviated as long as the abbreviation is unambiguous:
.Fl \-verb .Fl \-verb
is is
.Fl \-verbose , .Fl \-verbose ,
@@ -63,7 +63,52 @@ but
.Fl \-ver .Fl \-ver
is invalid because it could also be is invalid because it could also be
.Fl \-version . .Fl \-version .
The arguments are as follows: .Pp
Unless otherwise noted, passing
.Ql -
(a single dash) as a file name makes
.Nm
use standard input (for input files) or standard output (for output files).
To suppress this behavior, and open a file in the current directory actually called
.Ql - ,
pass
.Ql ./-
instead.
Using standard input or output for more than one file in a single command may produce unexpected results.
.Pp
.Nm
accepts decimal, hexadecimal, octal, and binary for numeric option arguments.
Decimal numbers are written as usual; hexadecimal numbers must be prefixed with either
.Ql $
or
.Ql 0x ;
octal numbers must be prefixed with either
.Ql &
or
.Ql 0o ;
and binary numbers must be prefixed with either
.Ql %
or
.Ql 0b .
(The prefixes
.Ql $
and
.Ql &
will likely need escaping or quoting to avoid being interpreted by the shell.)
Leading zeros (after the base prefix, if any) are accepted, and letters are not case-sensitive.
For example, all of these are equivalent:
.Ql 42 ,
.Ql 042 ,
.Ql 0x2A ,
.Ql 0X2A ,
.Ql 0x2a ,
.Ql &52 ,
.Ql 0o52 ,
.Ql 0O052 ,
.Ql 0b00101010 ,
.Ql 0B101010 .
.Pp
The following options are accepted:
.Bl -tag -width Ds .Bl -tag -width Ds
.It Fl B Ar param , Fl \-backtrace Ar param .It Fl B Ar param , Fl \-backtrace Ar param
Configures how location backtraces are printed if warnings or errors occur. Configures how location backtraces are printed if warnings or errors occur.