POSIX long command line arguments

315 views
Skip to first unread message

David Biesack

unread,
Jan 12, 2009, 1:19:00 PM1/12/09
to Protocol Buffers
Has there been any thought to adopting more conventional style GNU/
POSIX command line argument notation,
i.e. --java-out and --proto-path instead of --java_out and --
proto_path? The underscores always trip me up.

reference: http://www.gnu.org/prep/standards/standards.html#Option-Table
where '-' is common.

Kenton Varda

unread,
Jan 12, 2009, 2:08:24 PM1/12/09
to David Biesack, Protocol Buffers
Hmm, you're probably right that the arguments should have used hyphens rather than underscores.  That said, we certainly can't just change it without breaking people, and accepting both seems hacky.

David Biesack

unread,
Jan 12, 2009, 4:52:59 PM1/12/09
to Protocol Buffers
As a user, I'm less concerned with the internal hackiness level, more
so with the consistent
interface :-) The code is clean enough to support both, it appears.
I'd vote for it;
I can contribute some code if you like.

On Jan 12, 2:08 pm, Kenton Varda <ken...@google.com> wrote:
> Hmm, you're probably right that the arguments should have used hyphens
> rather than underscores.  That said, we certainly can't just change it
> without breaking people, and accepting both seems hacky.
>
> On Mon, Jan 12, 2009 at 10:19 AM, David Biesack <David.Bies...@sas.com>wrote:

Kenton Varda

unread,
Jan 12, 2009, 5:48:30 PM1/12/09
to David Biesack, Protocol Buffers
Well, hackiness usually leads to deeper problems.  For example, if there's two ways to write the flag, then it's harder to grep for usages of it, particularly if you aren't actually aware that there are multiple ways to write it.  I'm still leaning against this.

Anyone else have an opinion?

Dave Bailey

unread,
Jan 12, 2009, 6:11:04 PM1/12/09
to Protocol Buffers
It would lead to an inconsistency with all of the other compiler
options that adhere to the underscore convention:

--decode_raw
--descriptor_set_out
--disallow_services
--include_imports
--proto_path

I think either all or none of them should be changed.

-dave

On Jan 12, 2:48 pm, Kenton Varda <ken...@google.com> wrote:
> Well, hackiness usually leads to deeper problems.  For example, if there's
> two ways to write the flag, then it's harder to grep for usages of it,
> particularly if you aren't actually aware that there are multiple ways to
> write it.  I'm still leaning against this.
> Anyone else have an opinion?
>

Dave Bailey

unread,
Jan 12, 2009, 6:18:02 PM1/12/09
to Protocol Buffers
(Personally, I prefer the GNU option format, so my vote is that if a
patch that passes muster is provided, it should be used).

-dave

Alek Storm

unread,
Jan 12, 2009, 8:27:04 PM1/12/09
to Protocol Buffers
I'm for changing it. Command line flags get deprecated in software
all the time.

Kenton Varda

unread,
Jan 12, 2009, 8:30:19 PM1/12/09
to Alek Storm, Protocol Buffers
On Mon, Jan 12, 2009 at 5:27 PM, Alek Storm <alek....@gmail.com> wrote:

I'm for changing it.  Command line flags get deprecated in software
all the time.

Only for good reasons.  This isn't a good enough reason to deprecate.  So the options are between having just the underscore versions or accepting both underscores and hyphens.

David Biesack

unread,
Jan 13, 2009, 8:21:15 AM1/13/09
to Protocol Buffers
(I certainly meant all options with underscores; I just cited two for
brevity.)

The other thing to consider here is when new options need to be added;
if hyphens are not adopted now, "consistency" will mean new options
will also use underscores.

-djb
Reply all
Reply to author
Forward
0 new messages