From 08e8f724674eb96678dcabf856534c58f5c29996 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:50:59 +0000 Subject: Sync Author: jgg Date: 1998-09-22 05:30:24 GMT Sync --- cmdline/apt-cache.cc | 23 ++++++++++++++++++----- cmdline/makefile | 9 ++++++--- 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 4d0a076a8..85405941e 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: apt-cache.cc,v 1.6 1998/07/26 23:11:56 jgg Exp $ +// $Id: apt-cache.cc,v 1.7 1998/09/22 05:30:30 jgg Exp $ /* ###################################################################### apt-cache - Manages the cache file. @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -70,7 +71,7 @@ bool SplitArg(const char *Arg,string &File,string &Dist,string Ver) // DumpPackage - Show a dump of a package record /*{{{*/ // --------------------------------------------------------------------- /* */ -bool DumpPackage(pkgCache &Cache,int argc,char *argv[]) +bool DumpPackage(pkgCache &Cache,int argc,const char *argv[]) { for (int I = 0; I != argc; I++) { @@ -255,7 +256,7 @@ bool DumpAvail(pkgCache &Cache) // DoAdd - Perform an adding operation /*{{{*/ // --------------------------------------------------------------------- /* */ -bool DoAdd(int argc,char *argv[]) +bool DoAdd(int argc,const char *argv[]) { string FileName; string Dist; @@ -312,8 +313,21 @@ bool GenCaches() } /*}}}*/ -int main(int argc, char *argv[]) +int main(int argc,const char *argv[]) { + CommandLine::Args Args[] = { + {'h',"help","help",0}, + {0,0,0,0}}; + + CommandLine Cmds(Args,_config); + if (pkgInitialize(*_config) == false || + Cmds.Parse(argc,argv) == false) + { + _error->DumpErrors(); + return 100; + } + cout << _config->Find("help") << endl; + // Check arguments. if (argc < 3) { @@ -321,7 +335,6 @@ int main(int argc, char *argv[]) return 100; } - pkgInitialize(*_config); while (1) { CacheFile = argv[2]; diff --git a/cmdline/makefile b/cmdline/makefile index 2dd10d6bc..bbe1f5e46 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -5,11 +5,14 @@ SUBDIR=cmdline # Bring in the default rules include ../buildlib/defaults.mak -# The library name +# The apt-cache program PROGRAM=apt-cache SLIBS = -lapt-pkg - -# Source code for the contributed non-core things SOURCE = apt-cache.cc +include $(PROGRAM_H) +# The apt-config program +PROGRAM=apt-config +SLIBS = -lapt-pkg +SOURCE = apt-config.cc include $(PROGRAM_H) -- cgit v1.2.3