[LTP] [RFC PATCH 2/3] lib/C-API: Add option -V to print LTP version

Petr Vorel pvorel@suse.cz
Tue Jul 4 13:50:13 CEST 2023


Hi Cyril,

...
> > @@ -686,6 +688,10 @@ static void parse_opts(int argc, char *argv[])
> >  			else
> >  				duration = SAFE_STRTOF(optarg, 0.1, HUGE_VALF);
> >  		break;
> > +		case 'V':
> > +			fprintf(stderr, LTP_VERSION "\n");
> > +			exit(0);
> > +		break;

> Why don't we print that as a part of help? Do we really need to allocate
> a flag for this?

Well, people expect -V or --verbose. But because I add printing also on running
test, we could just move it to -h.

BTW I was also thinking about using getopt_long(), at least to allow --help,
I guess you don't think any value in it.

Kind regards,
Petr


More information about the ltp mailing list