dtb trinity
trinity pushed to dj-formatting at bonsai/harakit 2024-07-27 18:18:42 -06:00
cba8394d95 str(1): fix argv parsing and add comments
trinity commented on pull request bonsai/harakit#142 2024-07-27 18:14:16 -06:00
Formatting

s didn't work because the argv[0] you replaced later in the program wasn't the program name but an iterating pointer.

trinity pushed to dj-formatting at bonsai/harakit 2024-07-27 18:00:00 -06:00
199d48d85b swab(1): comment code
trinity commented on pull request bonsai/harakit#142 2024-07-27 17:42:59 -06:00
Formatting

Got it.

trinity commented on pull request bonsai/harakit#142 2024-07-27 17:27:19 -06:00
Formatting

What does this do?

trinity commented on pull request bonsai/harakit#142 2024-07-27 17:27:03 -06:00
Formatting

Maybe it should be OpType to be self-documenting.

trinity commented on pull request bonsai/harakit#142 2024-07-27 17:25:26 -06:00
Formatting

Instead of opts here I would call this a variant of arg. opts is a little misleading; this is used for all given arguments, not just parsed options.

trinity commented on pull request bonsai/harakit#142 2024-07-27 17:23:36 -06:00
Formatting

I'm not partial to either matching or using the clojure, but I think it should be consistent between programs.

trinity commented on pull request bonsai/harakit#142 2024-07-27 17:22:55 -06:00
Formatting

Emma: you told me that returning from main here would be impossible from a clojure. Would it be better to match the Result here to facilitate that?

trinity commented on pull request bonsai/harakit#142 2024-07-27 17:16:14 -06:00
Formatting

Would it be better to just return from main rather than calling a function?

trinity commented on pull request bonsai/harakit#142 2024-07-27 17:13:27 -06:00
Formatting

Instead of marking that this is to set the delimiter, I'd prefer a more descriptive name for the variable d (like delimiter). I'd also prefer:

trinity pushed to peek at bonsai/harakit 2024-07-26 07:58:46 -06:00
3f23e437e8 peek(1): more style fixes
trinity pushed to peek at bonsai/harakit 2024-07-26 07:42:18 -06:00
a927c39c06 peek(1): update style
trinity commented on pull request bonsai/harakit#93 2024-07-26 07:22:33 -06:00
peek(1)

I can't find a way to rewrite this in Rust without vendoring a crate or writing termios C bindings.

trinity commented on pull request bonsai/harakit#142 2024-07-26 07:15:27 -06:00
Formatting

The s ternary should be here, without an intermediate variable.

trinity commented on pull request bonsai/harakit#142 2024-07-26 07:14:36 -06:00
Formatting

I was under the impression you added the s variable to this program?

trinity commented on pull request bonsai/harakit#142 2024-07-26 07:11:32 -06:00
Formatting

I would put this in the same block as getopt(3p) to reduce cognitive load; That One Block is where arguments are interpreted.

trinity commented on pull request bonsai/harakit#142 2024-07-26 07:09:51 -06:00
Formatting

Moving the program_name ternary over here would be more efficient.

trinity pushed to main at trinity/src 2024-07-25 21:31:09 -06:00
fb38d75235 2024-07-25
trinity commented on pull request bonsai/harakit#142 2024-07-25 20:21:41 -06:00
Formatting

!any_int < 0 will always evaluate to 1.