summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/cmndline.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:06 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:06 +0000
commit3b5421b4c75f5c85b48cbb61bf22642ff52a6352 (patch)
tree1c2b393ca91c645c2b324eb20bf9c5492dbd1519 /apt-pkg/contrib/cmndline.cc
parent303a1703ca47c78f2b5ff6887ba6a10907465874 (diff)
Start on acquire stuff
Author: jgg Date: 1998-10-20 02:39:12 GMT Start on acquire stuff
Diffstat (limited to 'apt-pkg/contrib/cmndline.cc')
-rw-r--r--apt-pkg/contrib/cmndline.cc29
1 files changed, 4 insertions, 25 deletions
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);