- CommandLine::Args Args[] = {
- {'h',"help","help",0},
- {0,"version","version",0},
- {'q',"quiet","quiet",CommandLine::IntLevel},
- {'q',"silent","quiet",CommandLine::IntLevel},
- {'v',"verbose","APT::MarkAuto::Verbose",0},
- {'s',"simulate","APT::Mark::Simulate",0},
- {'s',"just-print","APT::Mark::Simulate",0},
- {'s',"recon","APT::Mark::Simulate",0},
- {'s',"dry-run","APT::Mark::Simulate",0},
- {'s',"no-act","APT::Mark::Simulate",0},
- {'f',"file","Dir::State::extended_states",CommandLine::HasArg},
- {'c',"config-file",0,CommandLine::ConfigFile},
- {'o',"option",0,CommandLine::ArbItem},
- {0,0,0,0}};
- CommandLine::Dispatch Cmds[] = {{"help",&ShowHelp},
- {"auto",&DoAuto},
- {"manual",&DoAuto},
- {"hold",&DoHold},
- {"unhold",&DoHold},
- {"showauto",&ShowAuto},
- {"showmanual",&ShowAuto},
- {"showhold",&ShowHold},
- // be nice and forgive the typo
- {"showholds",&ShowHold},
- // be nice and forgive it as it is technical right
- {"install",&DoHold},
- // obsolete commands for compatibility
- {"markauto", &DoMarkAuto},
- {"unmarkauto", &DoMarkAuto},
- {0,0}};
-
- // Set up gettext support
- setlocale(LC_ALL,"");
- textdomain(PACKAGE);
-
- // Parse the command line and initialize the package library
- CommandLine CmdL(Args,_config);
- if (pkgInitConfig(*_config) == false ||
- CmdL.Parse(argc,argv) == false ||
- pkgInitSystem(*_config,_system) == false)
- {
- if (_config->FindB("version") == true)
- ShowHelp(CmdL);
- _error->DumpErrors();
- return 100;
- }