[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: invalid options exits 0



On Tue, Jan 21, 2003 at 04:07:45PM -0500, James Olin Oden wrote:
> Is it intended that if one enters an invalid set of 
> options on the rpm command line, that rpm should return 0?
> This is certainly the behavior I just observed.
> 
> For instance, if one typed:
> 
> 	rpm qa
> 
> It will give the usage and such, but it will exit with 
> zero.  Would it not be more correct to have it return a
> positive exit code in the event that the commandline
> parameters were amiss?

In fact, /usr/lib/rpm/rpmq is exec'd to perform a query. If that
is invoked directly, then the behavior you are expecting is seen:

    bash$ /usr/lib/rpm/rpmq qa || echo "FAILED" 
    package qa is not installed
    FAILED

Detecting command line parameters that were amiss is trickier, as
rpm does not "know" its own command line parameters, many are
popt aliases.

I suppose a usage message could/should return 1.

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []