2024-02-01 20:41:57 -07:00
|
|
|
|
.\" Copyright (c) 2023–2024 DTB <trinity@trinity.moe>
|
2024-03-26 18:26:51 -06:00
|
|
|
|
.\" Copyright (c) 2023–2024 Emma Tebibyte <emma@tebibyte.media>
|
2023-12-24 17:13:17 -07:00
|
|
|
|
.\"
|
|
|
|
|
.\" This work is licensed under CC BY-SA 4.0. To see a copy of this license,
|
|
|
|
|
.\" visit <http://creativecommons.org/licenses/by-sa/4.0/>.
|
|
|
|
|
|
|
|
|
|
.TH STR 1
|
|
|
|
|
|
|
|
|
|
.SH NAME
|
|
|
|
|
|
|
|
|
|
str \(en test the character types of string arguments
|
|
|
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
|
|
|
|
|
str
|
|
|
|
|
.RB [ type ]
|
|
|
|
|
.RB [ string... ]
|
|
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
|
2024-03-26 19:22:30 -06:00
|
|
|
|
Test string arguments against each other.
|
|
|
|
|
|
|
|
|
|
The tests in this program are equivalent to the functions with the same names in
|
|
|
|
|
ctype.h(0p) and are the methods by which string arguments are tested.
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
|
|
|
|
.SH DIAGNOSTICS
|
|
|
|
|
|
2024-03-26 19:22:30 -06:00
|
|
|
|
If all tests pass, the program will exit with an exit code of 0. If any of the
|
|
|
|
|
tests fail, the program will exit unsuccessfully with an error code of 1.
|
2024-03-26 18:26:51 -06:00
|
|
|
|
|
2024-03-26 19:22:30 -06:00
|
|
|
|
An empty string will cause an unsuccessful exit as none of its contents pass any
|
|
|
|
|
tests.
|
2024-03-26 18:26:51 -06:00
|
|
|
|
|
2024-03-26 19:22:30 -06:00
|
|
|
|
When invoked incorrectly, a debug message will be printed and the program will
|
|
|
|
|
exit with the appropriate sysexits.h(3) error code.
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
|
|
|
|
.SH DEPRECATED FEATURES
|
|
|
|
|
|
2024-03-26 19:22:30 -06:00
|
|
|
|
Originally, there was an isvalue type as an extension to ctype.h(3), but it
|
|
|
|
|
was removed in favor of using strcmp(1) to compare strings against the empty
|
|
|
|
|
string ('').
|
2023-12-24 17:13:17 -07:00
|
|
|
|
|
|
|
|
|
.SH BUGS
|
|
|
|
|
|
2024-03-26 19:22:30 -06:00
|
|
|
|
There’s no way of knowing which argument failed the test without re-testing
|
2023-12-24 17:13:17 -07:00
|
|
|
|
arguments individually.
|
2024-03-26 18:26:51 -06:00
|
|
|
|
|
2023-12-24 17:13:17 -07:00
|
|
|
|
If a character in a string isn't valid ASCII str will exit unsuccessfully.
|
|
|
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
|
|
|
|
|
|
Written by DTB <trinity@trinity.moe>.
|
|
|
|
|
|
|
|
|
|
.SH COPYRIGHT
|
|
|
|
|
|
|
|
|
|
Copyright © 2023 DTB. License AGPLv3+: GNU AGPL version 3 or later
|
|
|
|
|
<https://gnu.org/licenses/gpl.html>.
|
|
|
|
|
|
|
|
|
|
.SH SEE ALSO
|
|
|
|
|
|
2024-02-01 20:41:57 -07:00
|
|
|
|
ctype(3p), strcmp(1), ascii(7)
|