Пример #1
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $this->force = $options->getOpt('force', false);
     $this->username = $options->getOpt('user', $this->getUser());
     $command = $options->getCmd();
     switch ($command) {
         case 'checkout':
             $wiki_id = array_shift($options->args);
             $localfile = array_shift($options->args);
             $this->commandCheckout($wiki_id, $localfile);
             break;
         case 'commit':
             $localfile = array_shift($options->args);
             $wiki_id = array_shift($options->args);
             $this->commandCommit($localfile, $wiki_id, $options->getOpt('message', ''), $options->getOpt('trivial', false));
             break;
         case 'lock':
             $wiki_id = array_shift($options->args);
             $this->obtainLock($wiki_id);
             $this->success("{$wiki_id} locked");
             break;
         case 'unlock':
             $wiki_id = array_shift($options->args);
             $this->clearLock($wiki_id);
             $this->success("{$wiki_id} unlocked");
             break;
         default:
             echo $options->help();
     }
 }
Пример #2
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     if ($options->getOpt('keep')) {
         $keep = explode(',', $options->getOpt('keep'));
         if (!in_array('en', $keep)) {
             $keep[] = 'en';
         }
     } elseif ($options->getOpt('english-only')) {
         $keep = array('en');
     } else {
         echo $options->help();
         exit(0);
     }
     // Kill all language directories in /inc/lang and /lib/plugins besides those in $langs array
     $this->stripDirLangs(realpath(dirname(__FILE__) . '/../inc/lang'), $keep);
     $this->processExtensions(realpath(dirname(__FILE__) . '/../lib/plugins'), $keep);
     $this->processExtensions(realpath(dirname(__FILE__) . '/../lib/tpl'), $keep);
 }
Пример #3
0
 /**
  * Your main program
  *
  * Arguments and options have been parsed when this is run
  *
  * @param DokuCLI_Options $options
  * @return void
  */
 protected function main(DokuCLI_Options $options)
 {
     $command = $options->getCmd();
     if (!$command) {
         $command = array_shift($options->args);
     }
     switch ($command) {
         case '':
             echo $options->help();
             break;
         case 'clone':
             $this->cmd_clone($options->args);
             break;
         case 'install':
             $this->cmd_install($options->args);
             break;
         case 'repo':
         case 'repos':
             $this->cmd_repos();
             break;
         default:
             $this->cmd_git($command, $options->args);
     }
 }