From 3b5421b4c75f5c85b48cbb61bf22642ff52a6352 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:51:06 +0000 Subject: Start on acquire stuff Author: jgg Date: 1998-10-20 02:39:12 GMT Start on acquire stuff --- apt-pkg/contrib/cmndline.cc | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'apt-pkg/contrib/cmndline.cc') diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index 7f5ab59a5..94ca4dc70 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: cmndline.cc,v 1.3 1998/10/08 04:55:01 jgg Exp $ +// $Id: cmndline.cc,v 1.4 1998/10/20 02:39:25 jgg Exp $ /* ###################################################################### Command Line Class - Sophisticated command line parser @@ -259,14 +259,10 @@ bool CommandLine::HandleOpt(int &I,int argc,const char *argv[], break; } - // Check for positives - if (strcasecmp(Argument,"yes") == 0 || - strcasecmp(Argument,"true") == 0 || - strcasecmp(Argument,"with") == 0 || - strcasecmp(Argument,"enable") == 0) + // Check for boolean + Sense = StringToBool(Argument); + if (Sense >= 0) { - Sense = 1; - // Eat the argument if (Argument != Buffer) { @@ -276,23 +272,6 @@ bool CommandLine::HandleOpt(int &I,int argc,const char *argv[], break; } - // Check for negatives - if (strcasecmp(Argument,"no") == 0 || - strcasecmp(Argument,"false") == 0 || - strcasecmp(Argument,"without") == 0 || - strcasecmp(Argument,"disable") == 0) - { - Sense = 0; - - // Eat the argument - if (Argument != Buffer) - { - Opt += strlen(Opt); - I += IncI; - } - break; - } - if (CertainArg == true) return _error->Error("Sense %s is not understood, try true or false.",Argument); -- cgit v1.2.3-70-g09d2