Add -e flag to explain what the previous smiley face means. This

requires us to also know what the previous return signal is, so
if XD is given a return code, it passes it through when finishing
execution.
This commit is contained in:
2025-02-18 14:29:09 -06:00
parent 6c099e3648
commit 6025b2d832
4 changed files with 98 additions and 10 deletions

40
XD.1
View File

@ -1,4 +1,4 @@
.Dd December 19, 2024
.Dd Febuary 18, 2025
.Dt XD 1
.Sh NAME
.Nm XD
@ -6,7 +6,9 @@
.Os
.Sh SYNOPSIS
.Nm
.Op Fl v|number
.Op Fl v
.Op Fl e
.Op number
.Sh DESCRIPTION
.Nm
Displays information using a smiley face like so: :)
@ -40,3 +42,37 @@ c;l.
/;command not found
(;previous signal is failure
.TE
.Sh OPTIONS
.Ss -v
Print version information to stdout and exit.
.Ss -e
Explain the output instead of putting a smiley face.
.Sh EXAMPLES
Running
.Nm
and passing in the previous return code ($?) results in a smiley face, if you
then follow that by \fBXD -e $?\fR then you will get an explination of what the
face is explaining.
$ \fBXD $?\fR
.br
:)
.br
$ \fBXD -e $?\fR
.br
Not in a git repository.
.br
Return code of 0, no errors.
$ \fBXD $?\fR
.br
;*O
.br
$ \fBXD -e $?\fR
.br
In a git repository.
.br
The're staged changes.
.br
Return code of 130, ctrl-c was pressed, or SIGTERM sent.