dj(1) null-byte padding: -A or -a ''? #101

Closed
opened 2024-04-29 23:23:28 +00:00 by trinity · 3 comments
Owner

I wonder if the way to configure the padding byte used with synchronization of partial reads to '\0' should be changed from -A to -a ''; that is, -a with an empty but present option argument.

Changing this now won't make much of a difference for existing code; dj(1)'s padding and dd(1p)'s conv=sync are both very rarely used, the dj(1) feature only existing for parity with POSIX.

There's precedent for both uses in other tools.

It may make more conceptual sense that dj -a "\0" works, but it may make less conceptual sense (to a novice) that dj -a '' -i file works but dj -a -i file does not.

Both uses would be treated as special cases in the code.

I'm leaning towards -a '' because I think it makes more sense and removes some clutter from the command synopsis.

I wonder if the way to configure the padding byte used with synchronization of partial reads to `'\0'` should be changed from `-A` to `-a ''`; that is, `-a` with an empty but present option argument. Changing this now won't make much of a difference for existing code; dj(1)'s padding and dd(1p)'s `conv=sync` are both very rarely used, the dj(1) feature only existing for parity with POSIX. There's precedent for both uses in other tools. It may make more conceptual sense that `dj -a "\0"` works, but it may make less conceptual sense (to a novice) that `dj -a '' -i file` works but `dj -a -i file` does not. Both uses would be treated as special cases in the code. I'm leaning towards `-a ''` because I think it makes more sense and removes some clutter from the command synopsis.
trinity added the
question
label 2024-04-29 23:23:28 +00:00
Author
Owner

It would not be too hard to make both usages work.

It would not be too hard to make both usages work.
Owner

I think this should be up to you.

I think this should be up to you.
Author
Owner

Decided in #125; dj -a '' will be the new, only way to specify nul byte alignment padding.

Decided in #125; `dj -a ''` will be the new, only way to specify nul byte alignment padding.
emma added reference dj 2024-06-27 20:06:14 +00:00
emma closed this issue 2024-06-30 03:57:02 +00:00
Sign in to join this conversation.
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.

Dependencies

No dependencies set.

Reference: bonsai/harakit#101
No description provided.