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

Open
opened 2024-04-29 23:23:28 +00:00 by trinity · 0 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
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 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/coreutils#101
No description provided.