Re: [dev] Better naming for arg.h API

From: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Mon, 5 Jul 2021 13:36:50 +0200

On Mon, Jul 05, 2021 at 02:48:10PM +0500, Nikita Zlobin wrote:
> For now all names in arg.h use ARG for prefix.
> However, considering existing argv parsing helpers like getopt, there
> could be two prefixes:
> OPT - for option key or name (for long opts)
> ARG - optional option value if any, argument.
>
> This way I could propose alternated naming, which would be more clear
> just by reading names in this header file:
>
> # Is 'C' in the end of ARGC to specify it's short opt?
> # If so, this means possible OPTS implementation
> # (single argv field, representing opts sequence,
> # would be OPTV in this case)
>
> - ARGBEGIN ARGEND ARGC
> + OPTBEGIN OPTEND OPTC
>
> # Same, why 'F' in the end?
> - EARGF ARGF ARGF_
> + EARG ARG ARG_
>

It is based on:
https://9fans.github.io/plan9port/man/man3/arg.html

argc (count) and argv (array of strings) are the program argument names.

-- 
Kind regards,
Hiltjo
Received on Mon Jul 05 2021 - 13:36:50 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 05 2021 - 13:48:07 CEST