1
0

str(1) manpage

This commit is contained in:
dtb 2022-07-04 22:22:17 -04:00
parent 5048212260
commit b3b27ceff1
3 changed files with 37 additions and 27 deletions

35
man/str.1 Normal file
View File

@ -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.

View File

@ -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.

View File

@ -3,7 +3,7 @@
#include <string.h> /* strcmp(3) */
#include <sysexits.h>
#include <unistd.h> /* 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;
}