eep(1) #103

Open
trinity wants to merge 16 commits from sleep into main
Owner

This implements #83.

This implements #83.
trinity added the
enhancement
label 2024-05-03 21:17:54 -06:00
trinity added 2 commits 2024-05-03 21:17:54 -06:00
trinity requested review from emma 2024-05-03 21:18:18 -06:00
trinity added 6 commits 2024-05-03 21:32:25 -06:00
Owner

Can we call it eep(1)?

Can we call it `eep(1)`?
Author
Owner

Sure but you have to rename it on the branch.

Sure but you have to rename it on the branch.
emma added 1 commit 2024-05-29 19:38:33 -06:00
emma changed title from sleep(1) to eep(1) 2024-05-29 19:39:09 -06:00
emma added 2 commits 2024-06-08 23:50:50 -06:00
emma added 1 commit 2024-06-08 23:52:48 -06:00
emma requested changes 2024-06-08 23:54:03 -06:00
docs/eep.1 Outdated
@ -0,0 +17,4 @@
.SH DESCRIPTION
Eep waits the given amount of seconds before exiting.
Owner

Eep waits a given number of seconds

> `Eep waits a given number of seconds`
emma marked this conversation as resolved
docs/eep.1 Outdated
@ -0,0 +41,4 @@
seconds, five times, using rpn(1) and xargs(1p).
.RS
.R $ rpn 60 5 '*' | xargs eep
Owner

.R is invalid man roff.

`.R` is invalid man roff.
emma marked this conversation as resolved
docs/eep.1 Outdated
@ -0,0 +46,4 @@
.SH COPYRIGHT
Copyright (c) 2024 DTB. License AGPLv3+: GNU AGPL version 3 or later
Owner

Copyright \(co 2024 DTB.

> `Copyright \(co 2024 DTB.`
emma marked this conversation as resolved
docs/eep.1 Outdated
@ -0,0 +51,4 @@
.SH SEE ALSO
sleep(3)
Owner

Should you reference sleep(1p) as well?

Should you reference `sleep(1p)` as well?
emma marked this conversation as resolved
docs/sleep.1 Outdated
@ -0,0 +16,4 @@
.SH DESCRIPTION
Sleep waits the given amount of seconds before exiting.
Owner

Wait a number of seconds before exiting.

Wait a number of seconds before exiting.
emma marked this conversation as resolved
docs/sleep.1 Outdated
@ -0,0 +21,4 @@
.SH DIAGNOSTICS
Sleep exits successfully when the time specified has elapsed, or unsuccessfully
if the time fails to elapse or if invoked incorrectly. In the latter scenario
Owner

If the specified time fails to elapse or in the case of incorrect invocation, the program will
exit unsuccessfully. In the latter scenario, a debug message will be printed.

For parity with other man pages.

> If the specified time fails to elapse or in the case of incorrect invocation, the program will exit unsuccessfully. In the latter scenario, a debug message will be printed. [For parity with other man pages](https://git.tebibyte.media/bonsai/coreutils/pulls/93#issuecomment-4547).
emma marked this conversation as resolved
docs/sleep.1 Outdated
@ -0,0 +26,4 @@
.SH BUGS
User may still be tired after invoking sleep.
Owner

The user my still be tired after invocation.

> The user my still be tired after invocation.
emma marked this conversation as resolved
docs/sleep.1 Outdated
@ -0,0 +30,4 @@
.SH EXAMPLES
The following invocation sleeps for five seconds.
Owner

[...] for five seconds:

> [...] for five seconds:
emma marked this conversation as resolved
src/eep.rs Outdated
@ -0,0 +27,4 @@
use sysexits::EX_USAGE;
fn usage(s: &str) -> ExitCode {
eprintln!("Usage: {} [seconds]", s);
Owner

"Usage: {} seconds"

> `"Usage: {} seconds"`
Owner

A patch containing my recommended changes:

diff --git a/docs/eep.1 b/docs/eep.1
index 150c5b6..1032535 100644
--- a/docs/eep.1
+++ b/docs/eep.1
@@ -3,52 +3,41 @@
 .\"
 .\" 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 EEP 1
-
 .SH NAME
-
 eep \(en wait a moment
-
+.\"
 .SH SYNOPSIS
 
 eep
 .RB [ seconds ]
-
+.\"
 .SH DESCRIPTION
 
-Eep waits the given amount of seconds before exiting.
-
+Wait a specified number of seconds before exiting.
+.\"
 .SH DIAGNOSTICS
 
-Eep exits successfully when the time specified has elapsed, or unsuccessfully
-if the time fails to elapse or if invoked incorrectly. In the latter scenario
-eep will also print a usage synopsis.
-
-.SH BUGS
-
-User may still be tired after invoking eep.
-
-.SH EXAMPLES
-
-The following invocation eeps for five seconds.
-
-.RS
-.R eep 5
-.RE
-
-The following sh(1p) command line eeps for five minutes, or for sixty
-seconds, five times, using rpn(1) and xargs(1p).
+If the specified time fails to elapse or in the case of incorrect invocation,
+the program will exit unsuccessfully. In the latter scenario, a debug message
+will be printed.
+.\"
+.SH CAVEATS
 
-.RS
-.R $ rpn 60 5 '*' | xargs eep
-.RE
+User may still be tired after invocation.
+.\"
+.SH AUTHOR
 
+Written by DTB
+.MT trinity@trinity.moe
+.ME .
+.\"
 .SH COPYRIGHT
 
-Copyright (c) 2024 DTB. License AGPLv3+: GNU AGPL version 3 or later
+Copyright \(co 2024 DTB. License AGPLv3+: GNU AGPL version 3 or later
 <https://gnu.org/licenses/gpl.html>.
-
+.\"
 .SH SEE ALSO
-
-sleep(3)
+.BR sleep (3p)
+.BR sleep (1p)
A patch containing my recommended changes: ``` diff --git a/docs/eep.1 b/docs/eep.1 index 150c5b6..1032535 100644 --- a/docs/eep.1 +++ b/docs/eep.1 @@ -3,52 +3,41 @@ .\" .\" 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 EEP 1 - .SH NAME - eep \(en wait a moment - +.\" .SH SYNOPSIS eep .RB [ seconds ] - +.\" .SH DESCRIPTION -Eep waits the given amount of seconds before exiting. - +Wait a specified number of seconds before exiting. +.\" .SH DIAGNOSTICS -Eep exits successfully when the time specified has elapsed, or unsuccessfully -if the time fails to elapse or if invoked incorrectly. In the latter scenario -eep will also print a usage synopsis. - -.SH BUGS - -User may still be tired after invoking eep. - -.SH EXAMPLES - -The following invocation eeps for five seconds. - -.RS -.R eep 5 -.RE - -The following sh(1p) command line eeps for five minutes, or for sixty -seconds, five times, using rpn(1) and xargs(1p). +If the specified time fails to elapse or in the case of incorrect invocation, +the program will exit unsuccessfully. In the latter scenario, a debug message +will be printed. +.\" +.SH CAVEATS -.RS -.R $ rpn 60 5 '*' | xargs eep -.RE +User may still be tired after invocation. +.\" +.SH AUTHOR +Written by DTB +.MT trinity@trinity.moe +.ME . +.\" .SH COPYRIGHT -Copyright (c) 2024 DTB. License AGPLv3+: GNU AGPL version 3 or later +Copyright \(co 2024 DTB. License AGPLv3+: GNU AGPL version 3 or later <https://gnu.org/licenses/gpl.html>. - +.\" .SH SEE ALSO - -sleep(3) +.BR sleep (3p) +.BR sleep (1p) ```
trinity added 1 commit 2024-06-26 09:16:15 -06:00
trinity added 1 commit 2024-06-26 15:38:00 -06:00
emma reviewed 2024-06-26 16:01:18 -06:00
@ -121,0 +122,4 @@
eep: build/bin/eep
build/bin/eep: src/eep.rs build rustlibs
$(RUSTC) $(RUSTFLAGS) \
--extern sysexits=build/o/libsysexits.rlib \
Owner

This is unnecessary due to the merge-in of the main branch: $(RUSTLIBS) was introduced.

This is unnecessary due to the merge-in of the main branch: `$(RUSTLIBS)` was introduced.
Owner

This is now out-of-date; $(RUSTLIBS) has been removed in favor of appending to $(RUSTFLAGS).

This is now out-of-date; `$(RUSTLIBS)` has been removed in favor of appending to `$(RUSTFLAGS)`.
trinity marked this conversation as resolved
emma added a new dependency 2024-06-29 22:02:10 -06:00
emma reviewed 2024-07-15 14:13:03 -06:00
@ -0,0 +35,4 @@
let argv = args().collect::<Vec<String>>();
if argv.len() == 2 {
if let Ok(s) = argv[1].parse::<u64>() {
Owner

This could theoretically be a u128 to allow larger numbers.

This could theoretically be a `u128` to allow larger numbers.
Author
Owner

Perhaps that can be a feature for coma(1).

Perhaps that can be a feature for coma(1).
Author
Owner

Duration::from_secs needs a u64 which was the basis of that decision.

[Duration::from_secs](https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_secs) needs a u64 which was the basis of that decision.
emma marked this conversation as resolved
trinity added 1 commit 2024-07-15 15:46:07 -06:00
trinity added 1 commit 2024-08-21 22:03:13 -06:00
trinity requested review from emma 2024-08-21 22:03:34 -06:00
This pull request has changes conflicting with the target branch.
  • Makefile

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin sleep:sleep
git checkout sleep
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
#96 testing
bonsai/harakit
Reference: bonsai/harakit#103
No description provided.