[Toybox] Thinking about fuser.

enh enh at google.com
Thu May 10 14:59:10 PDT 2018


"i have no existing users for this so my opinion is worthless, but..."

breaking any existing users for consistency doesn't sound worth the
trouble? YAGNI.

On Thu, May 10, 2018 at 8:06 AM, Rob Landley <rob at landley.net> wrote:
> I haven't implemented fuser because the way it works is kinda stupid. And
> inconsistent with how things like "grep" work.
>
> I'm pondering doing an fuser that works like grep, as in all the output goes to
> stdout when there isn't an error, but if you give it one file it doesn't prefix
> it with filename: and if you give it multiple files it does by default but
> there's an option to switch it off.
>
> BUT: that's not how the existing fuser works. The _lack_ of a command isn't
> explicitly nonconformant, this would be. But what this would be is _consistent_,
> working the same way other commands work.
>
> Unsure whether or not I should do that. Any opinions? (If you have a script
> doing "fuser onefile 2>/dev/null" both would work the same way, but if your
> script is doing "fuser file file file" it wouldn't. You'd have to add.. what's
> the grep option... -h. You'd have to change your script to say "fuser -h one two
> three".)
>
> I suppose what I could do is have a --posix and then you can alias fuser "fuser
> --posix" in your /etc/profile and then if you really need the old behavior...?
>
> (This isn't like cut -DF because you have to explicitly add those flags to get
> the different behavior. That extends the spec rather than violating it.)
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net



More information about the Toybox mailing list