Page MenuHomeFreeBSD

yes: Completely overengineer
Needs ReviewPublic

Authored by des on Mon, Mar 2, 3:55 PM.
Tags
None
Referenced Files
F146464692: D55617.diff
Mon, Mar 2, 9:57 PM
F146454123: D55617.id.diff
Mon, Mar 2, 8:00 PM
F146453928: D55617.id173017.diff
Mon, Mar 2, 7:58 PM
F146453923: D55617.id173016.diff
Mon, Mar 2, 7:58 PM
F146453818: D55617.id173018.diff
Mon, Mar 2, 7:57 PM
Subscribers

Details

Reviewers
gahr
Group Reviewers
Klara
Summary

If we're going to overengineer this, we may as well go all the way.
Well, most of the way. I didn't feel like adding long options.

  • Add a getopt() loop and a usage message.
  • If multiple arguments are given, concatenate them into a space- separated list like GNU coreutils does.
  • When duplicating the expletive, do so exponentially.
  • Most importantly, don't modify the memory that argv points to.

This will now behave mostly like GNU coreutils, except for the absence
of the --help and --version options.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 71151
Build 68034: arc lint + arc unit

Event Timeline

des requested review of this revision.Mon, Mar 2, 3:55 PM
des added a reviewer: gahr.

This changes yes -foo from emitting -foo to an error. Do we really want that for the sake of compatibility with GNU's version?

gahr requested changes to this revision.Mon, Mar 2, 10:06 PM
This revision now requires changes to proceed.Mon, Mar 2, 10:06 PM
usr.bin/yes/yes.c
95

Leftover?

This changes yes -foo from emitting -foo to an error. Do we really want that for the sake of compatibility with GNU's version?

That's not just “compatibility with GNU”, it's consistency with our other command-line utilities (except df and echo, which are special for historical reasons).

usr.bin/yes/yes.c
95

Yes. I thought I'd removed it...

really remove debugging printf

des marked an inline comment as done.Tue, Mar 3, 12:00 PM