Commit Graph

66 Commits

Author SHA1 Message Date
Antonio Niño Díaz
3d8396b86f Remove progname variable
The error message shouldn't specify the name of the binary, that's
supposed to be known by the caller.

Update test reference outputs.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2017-04-08 18:10:14 +01:00
AntonioND
25be5c6561 Improve error and warning output
Improve error messages generated by `errx()`, `warnx()` and similar.

Set `progname` to a static string with the name of the program so that
the path of the binary isn't included in error messages.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-03 21:16:43 +01:00
stag019
6438ae2591 Remove __progname; add progname set to argv[0] in each main(). 2015-03-09 13:57:04 -04:00
Anthony J. Bentley
33ae6d8ca3 Use long for file offsets. 2015-03-07 14:21:57 -07:00
Anthony J. Bentley
8534f3a148 Unify usage strings/functions across programs.
The funny spacing is to make it easier to keep to 80 characters/line.
2015-01-07 23:13:18 -07:00
Anthony J. Bentley
bdc6401eba rgbfix: deal with options and arguments in the right order. 2015-01-07 23:07:09 -07:00
Anthony J. Bentley
21d0b402d3 Don't unnecessarily initialize variables. 2015-01-07 22:59:06 -07:00
Anthony J. Bentley
1e1339467e Use POSIX 2001 as the base standard. 2014-11-06 21:39:36 -07:00
stag019
80e2129f22 Merge https://github.com/bentley/rgbds
Conflicts:
	include/lib/types.h
	src/asm/symbol.c
2014-11-02 01:00:20 -05:00
Anthony J. Bentley
d661b3a532 Now that we replace missing libc functions, switch back to err(). 2014-09-24 02:50:39 -06:00
Anthony J. Bentley
c0be5ddbb2 Remove dead stores. 2014-09-24 01:19:05 -06:00
Anthony J. Bentley
08b1b97a45 Preserve the ability to set pad_value in rgbfix. 2014-02-09 02:58:00 -07:00
Anthony J. Bentley
17192ea6f0 Improve performance when padding: don't write a byte at a time. 2014-02-08 23:26:43 -07:00
stag019
c61c112218 Remove GNU-specific <getopt.h>. getopt() is defined in <unistd.h> in POSIX, which adding #define _XOPEN_SOURCE 500 causes GCC to include. 2013-12-23 14:57:06 -05:00
Anthony J. Bentley
8811784b71 rgbfix: exit on invalid usage. 2013-04-11 09:28:38 -06:00
Vegard Nossum
eb4f790a82 Include getopt.h (fix compilation on GNU/Linux)
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
2012-10-21 06:05:30 +02:00
Anthony J. Bentley
fd724d10e4 Add support for the four‐character game ID. 2011-12-29 20:22:06 -07:00
Anthony J. Bentley
5d6559f15f Remove nonstandard <err.h>.
This provides some really nice functions, but does not exist in some
environments (particularly MinGW).
2011-12-02 01:23:23 -07:00
Anthony J. Bentley
d784b14615 Remove unneeded include. 2011-04-11 20:00:52 -06:00
Anthony J. Bentley
d2f52fdd0c Rewrite rgbfix from scratch, under a free ISC license.
Slight changes in usage; the man page has been updated accordingly.
2010-12-22 13:48:44 -07:00
Anthony J. Bentley
05be8e0011 Delete rgbfix, to be replaced with a freely-licensed version 2010-12-22 13:19:37 -07:00
bentley
7293da9084 fix some error messages: err() instead of errx(strerror()) 2010-02-17 18:28:03 -07:00
bentley
aea1990de3 rgbfix: minor correction to last error message commit 2010-01-18 16:29:48 -07:00
bentley
f97e856a1f rgbfix: improve file open error message 2010-01-18 16:17:13 -07:00
bentley
e5ba184ef3 fix strcpy() warning on OpenBSD 2010-01-15 17:07:33 -07:00
bentley
b69cd0c345 -v doesn't need to modify ROM size; -p can do that 2010-01-13 11:22:56 -07:00
bentley
2da63e2f7d cosmetic change: rearrange getopt() switch for easier reading
cases are put in alphabetical order, to match the getopt string.
2010-01-13 10:08:23 -07:00
bentley
0b647c5a25 move color only flag to -c, color compatible flag to -C 2010-01-13 10:04:42 -07:00
bentley
2d5c193e6d move MBC option from -b to -m 2010-01-13 09:50:02 -07:00
bentley
cd52e3c56c move ramsize option from -m to -r 2010-01-13 09:48:13 -07:00
bentley
5931973029 fix compile error on Linux 2010-01-13 08:26:48 -07:00
bentley
a913dc01b5 remove unused variable argn (no longer needed due to getopt(3) usage) 2010-01-13 07:33:02 -07:00
bentley
9da8db3ce1 fix cast warnings 2010-01-13 07:31:34 -07:00
bentley
cdb90cea29 remove archaic 512KiB error, replace with 8MiB warning 2010-01-12 22:46:53 -07:00
bentley
d0a03bc99b pad option now changes the ROM size at 0x148 2010-01-12 22:40:37 -07:00
bentley
cba8933c11 remove unneeded carttype checking in -v
To simplify the code, remove the carttype work in the -v option.
Because the MBC option already alters it, this one is superfluous.
2010-01-12 21:21:48 -07:00
bentley
b2a4f54f59 rename PrintUsage() to usage(), and return EX_USAGE 2010-01-12 19:52:42 -07:00
bentley
5fe2bcbeed use errx(3) and warnx(3) instead of rolling our own error functions 2010-01-12 19:44:21 -07:00
bentley
fd9901a280 remove the -r (truncate) option
I can't think of a single use case for the -r (truncate) option.
It has been removed to make the code simpler.

If you do use it and have good reason to do so, let me know and I
will consider putting it back in.
2010-01-12 19:05:23 -07:00
bentley
f617078fda finish minor consistency output changes 2010-01-12 18:42:32 -07:00
anthony
198fcfaab3 minor text output changes
- Put quotes around string arguments
- Be consistent with spacing and colons
- Use 0xnn instead of 0Xnn
2010-01-12 18:17:31 -07:00
anthony
ac5b311005 use SI units (KiB) instead of the ambiguous kB 2010-01-12 18:04:42 -07:00
anthony
c3fa922c2f fix quiet mode oversight
A line never printed because it checks for the wrong flag instead
of OPTF_QUIET. This fixes it.
2010-01-12 17:55:07 -07:00
anthony
b23c5ab4ba rewrite usage to match new getopt() option format 2010-01-12 17:33:08 -07:00
anthony
16c7a49ffa use getopt(3) instead of our hand-rolled flag parsing
Simplify and standardize the code by using the standard getopt()
function for parsing command-line flags.

This is a backwards-incompatible change.
2010-01-12 14:25:54 -07:00
anthony
f9e443b10c get rid of a strcpy() warning on OpenBSD 2010-01-05 14:08:18 -07:00
anthony
290c65e9b2 minor spacing changes in output 2010-01-04 20:11:52 -07:00
anthony
8f1ad7f9fc the -k flag wrote to the wrong location. fixing the bug 2010-01-04 20:09:05 -07:00
anthony
f0361ee025 many of the flags did not respect -d (debug) flag. this fixes them. 2010-01-04 20:04:25 -07:00
anthony
3649cec52d add -k option to set new licensee code 2010-01-04 20:00:34 -07:00