diff --git a/man/str.1 b/man/str.1 new file mode 100644 index 0000000..fc0aa96 --- /dev/null +++ b/man/str.1 @@ -0,0 +1,35 @@ +.TH STRIS 1 + +.SH NAME + +str \(en test the character types of string arguments + +.SH SYNOPSIS + +str +.RB [ type ] +.RB [ string... ] + +.SH DESCRIPTION + +Str tests each character in an arbitrary quantity of string arguments against the function of the same name within ctype(3). + +.SH DIAGNOSTICS + +Strexits successfully if all tests pass and unsuccessfully if a test failed. +.PP +Str will print a message to standard error and exit unsuccessfully if used improperly. + +.SH BUGS + +There's no way of knowing which argument failed the test without re-testing arguments individually. +.PP +If a character in a string isn't valid ASCII the behavior of this program is undefined. + +.SH SEE ALSO + +ctype(3), ascii(7) + +.SH COPYRIGHT + +Public domain. diff --git a/man/stris.1 b/man/stris.1 deleted file mode 100644 index ed9ee3f..0000000 --- a/man/stris.1 +++ /dev/null @@ -1,25 +0,0 @@ -.TH STRIS 1 - -.SH NAME - -stris \(en test if arguments are numbers - -.SH SYNOPSIS - -stris -.RB { float , int , uint } -[number...] - -.SH DESCRIPTION - -Stris tests an arbitrary amount of numbers against one of three properties: float, int, or uint; which correspond to whether the numbers are all representable as floating-point values, integers, or unsigned (absolute) integers. -.PP -Stris exits successfully if all given numbers match the specified property, and unsuccessfully if stris was used improperly or the numbers did not match the specified property. - -.SH BUGS - -Non-simple numbers that are technically representable as floating-point numbers may not be recognized. This includes infinity, negative infinity, and NaN. - -.SH COPYRIGHT - -Public domain. diff --git a/src/str.c b/src/str.c index e93c4d5..58bf28f 100644 --- a/src/str.c +++ b/src/str.c @@ -3,7 +3,7 @@ #include /* strcmp(3) */ #include #include /* write(2) */ -#include "libio.h" /* fdputs(3) */ +#include "libio.h" /* fdprint(3) */ #include "usefulmacros.h" static char *program_name = "str"; @@ -32,7 +32,7 @@ int main(int argc, char *argv[]){ if(argc < 3){ error: write(2, "Usage: ", 7); - fdputs(2, argv[0] == NULL ? program_name : argv[0]); + fdprint(2, argv[0] == NULL ? program_name : argv[0]); write(2, " [type] [string...]\n", 20); return EX_USAGE; }