Handle the -propertyfile argument.

@param array $args
@param int $pos

@return int

@throws ConfigurationException
@throws IOException
514624
private function handleArgPropertyFile(array $args, int $pos): int
    {
        if (!isset($args[$pos + 1])) {
            throw new ConfigurationException('You must specify a filename when using the -propertyfile argument');
        }

        $this->propertyFiles[] = $args[++$pos];

        return $pos;
    }
1347574
public function call($args = [])
    {
        if (count($args) == 0 || empty($args[2]))
            throw new NoticeException('Command "'.$this->key.'": Expecting an object to resigter (widget|type).');

        $object = explode(':', $args[2]);

        switch ($object[0]) {
            case 'widget':
                if (!isset($object[1]) || empty($object[1]))
                    throw new NoticeException('Command "'.$this->key.'": Expecting a widget class name.');
                $this->registerWidget($object[1], $args);
                break;
            case 'type':
                if (!isset($object[1]) || empty($object[1]))
                    throw new NoticeException('Command "'.$this->key.'": Expecting a post type. I.e. "ayuco register type:book" (where "book" would be the type)');
                // Prepare
                $model = !isset($args[3]) || empty($args[3]) ? ucfirst($object[1]) : $args[3];
                $controller = !isset($args[4]) || empty($args[4]) ? null : $args[4];
                // Create controller
                $this->createModel($model);
                // Set properties
                $this->createModelProperty($model, 'type', $object[1]);
                $this->createModelProperty($model, 'aliases', []);
                if ($controller) {
                    $this->createModelProperty($model, 'registry_controller', $controller);
                    $this->createModelProperty($model, 'registry_metabox', ['title'=>'Meta fields','context'=>'normal','priority'=>'default']);
                    // Create controller
                    $this->createModelController($controller);
                    $this->createControllerProperty($controller, 'model', $this->config['namespace'].'\\Models\\'.$model);
                    // Create view
                    $this->createView('admin.metaboxes.'.$object[1].'.meta', 'metabox.php');
                }
                // Register model at bridge
                $builder = Builder::parser($this->rootPath.'/app/Main.php');
                $builder->addVisitor(new AddMethodCallVisitor('init', 'add_model', [$model]));
                $builder->build();
                break;
            case 'model':
                if (!isset($object[1]) || empty($object[1]))
                    throw new NoticeException('Command "'.$this->key.'": Expecting a model name.');
                // Register model at bridge
                $builder = Builder::parser($this->rootPath.'/app/Main.php');
                $builder->addVisitor(new AddMethodCallVisitor('init', 'add_model', [$object[1]]));
                $builder->build();
                // Print end
                $this->_print('Model registered!');
                $this->_lineBreak();
                break;
            case 'asset':
                if (!isset($object[1]) || empty($object[1]))
                    throw new NoticeException('Command "'.$this->key.'": Expecting an asset relative path.');
                // Register model at bridge
                $builder = Builder::parser($this->rootPath.'/app/Main.php');
                $builder->addVisitor(new AddMethodCallVisitor('init', 'add_asset', [$object[1]]));
                $builder->build();
                // Print end
                $this->_print('Asset registered!');
                $this->_lineBreak();
                break;
        }
    }
83362
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setSportId($value);
                break;
            case 2:
                $this->setName($value);
                break;
            case 3:
                $this->setAlternativeName($value);
                break;
            case 4:
                $this->setSlug($value);
                break;
            case 5:
                $this->setDescription($value);
                break;
            case 6:
                $this->setHistory($value);
                break;
            case 7:
                $this->setIsTranslation($value);
                break;
            case 8:
                $this->setIsRotation($value);
                break;
            case 9:
                $this->setIsAcyclic($value);
                break;
            case 10:
                $this->setIsCyclic($value);
                break;
            case 11:
                $this->setLongitudinalFlags($value);
                break;
            case 12:
                $this->setLatitudinalFlags($value);
                break;
            case 13:
                $this->setTransversalFlags($value);
                break;
            case 14:
                $this->setMovementDescription($value);
                break;
            case 15:
                $this->setSequencePictureUrl($value);
                break;
            case 16:
                $this->setVariationOfId($value);
                break;
            case 17:
                $this->setStartPositionId($value);
                break;
            case 18:
                $this->setEndPositionId($value);
                break;
            case 19:
                $this->setIsComposite($value);
                break;
            case 20:
                $this->setIsMultiple($value);
                break;
            case 21:
                $this->setMultipleOfId($value);
                break;
            case 22:
                $this->setMultiplier($value);
                break;
            case 23:
                $this->setGeneration($value);
                break;
            case 24:
                $this->setImportance($value);
                break;
            case 25:
                $this->setPictureId($value);
                break;
            case 26:
                $this->setVideoId($value);
                break;
            case 27:
                $this->setTutorialId($value);
                break;
            case 28:
                $this->setKstrukturId($value);
                break;
            case 29:
                $this->setFunctionPhaseId($value);
                break;
            case 30:
                $this->setObjectId($value);
                break;
            case 31:
                $this->setVersion($value);
                break;
            case 32:
                $this->setVersionCreatedAt($value);
                break;
            case 33:
                $this->setVersionComment($value);
                break;
        } // switch()

        return $this;
    }
223204
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setName($value);
                break;
            case 2:
                $this->setRole($value);
                break;
        } // switch()
    }
1261213
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setDealerId($value);
                break;
            case 2:
                $this->setDay($value);
                break;
            case 3:
                $this->setBegin($value);
                break;
            case 4:
                $this->setEnd($value);
                break;
            case 5:
                $this->setClosed($value);
                break;
            case 6:
                $this->setPeriodBegin($value);
                break;
            case 7:
                $this->setPeriodEnd($value);
                break;
            case 8:
                $this->setCreatedAt($value);
                break;
            case 9:
                $this->setUpdatedAt($value);
                break;
            case 10:
                $this->setVersion($value);
                break;
            case 11:
                $this->setVersionCreatedAt($value);
                break;
            case 12:
                $this->setVersionCreatedBy($value);
                break;
            case 13:
                $this->setDealerIdVersion($value);
                break;
        } // switch()
    }
997680
public function execute(array $args = [], array $options = [])
    {
        $argv = $_SERVER['argv'];
        array_shift($argv);
        array_shift($argv);

        $argvString = '';
        foreach ($argv as $arg) {
            $argvString .= ($argvString ? ' ' : '').'"'.str_replace('"', '\\"', $arg).'"';
        }
        $found = null;
        foreach ($this->getConfig()->get('_shell_scripts_dirs', []) as $dir) {
            $path = sprintf('%s/%s', $dir, $this->script);
            if (!is_file($path)) {
                continue;
            }
            $found = $path;
        }
        if (null === $found) {
            throw new \RuntimeException(sprintf("Unknown shell script '%s'", $this->script), 412);
        }

        $this->executeShellCommand(sprintf('%s %s', $found, $argvString), $options);
    }
555721
public function handle(Args $args, IO $io)
    {
        $path = Path::makeAbsolute($args->getArgument('path'), $this->currentPath);

        $resource = $this->repo->get($path);

        if (!$resource->hasChildren()) {
            throw new RuntimeException(sprintf(
                'The resource "%s" does not have children.',
                $resource->getPath()
            ));
        }

        if ($args->isOptionSet('long')) {
            $this->listLong($io, $resource->listChildren());

            return 0;
        }

        $this->listShort($io, $resource->listChildren());

        return 0;
    }
806347
public static void main(final String[] args) {
        String propertyFile = System.getProperty("file");
        if (propertyFile == null) {
            System.out.println("Property file not given, exiting.");
            System.exit(0);
        }
        final Properties properties = new Properties();
        try {
            properties.load(new FileInputStream(propertyFile));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException ie) {
            ie.printStackTrace();
        }
        recommend(properties);
    }
602340
protected function setNodeProperties(NodeInterface $node, array $properties, array $args = [])
    {
        foreach ($properties as $property => $value) {
            $value = count($args) && is_string($value) ? vsprintf($value, $args) : $value;
            $node->setProperty($property, $value);
        }
    }
1094725
public function handleList(Args $args, IO $io)
    {
        $raw = !$args->isOptionSet('parsed');
        $userValues = $this->manager->getConfigKeys(false, false, $raw);
        $effectiveValues = $this->manager->getConfigKeys(true, true, $raw);

        $table = new Table(PuliTableStyle::borderless());
        $table->setHeaderRow(array('Config Key', 'User Value', 'Effective Value'));

        foreach ($effectiveValues as $key => $value) {
            $table->addRow(array(
                sprintf('<c1>%s</c1>', $key),
                array_key_exists($key, $userValues)
                    ? StringUtil::formatValue($userValues[$key], false)
                    : '',
                StringUtil::formatValue($value, false),
            ));
        }

        $table->render($io);

        return 0;
    }
917400
public function handle(Args $args, IO $io)
    {
        $moduleFile = $this->moduleFileManager->getModuleFile();
        $originVersion = $moduleFile->getVersion();
        $targetVersion = $args->getArgument('version');

        if (version_compare($originVersion, $targetVersion, '=')) {
            $io->writeLine(sprintf('Your puli.json is already at version %s.', $targetVersion));

            return 0;
        }

        $this->moduleFileManager->migrate($targetVersion);

        $io->writeLine(sprintf(
            'Migrated your puli.json from version %s to version %s.',
            $originVersion,
            $targetVersion
        ));

        return 0;
    }
1145529
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setDtCall($value);
                break;
            case 2:
                $this->setRemoteAppId($value);
                break;
            case 3:
                $this->setStatuscode($value);
                break;
            case 4:
                $this->setLastResponse($value);
                break;
        } // switch()
    }
212688
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setAttributeAvId($value);
                break;
            case 2:
                $this->setAttributeAttributeTypeId($value);
                break;
            case 3:
                $this->setLocale($value);
                break;
            case 4:
                $this->setValue($value);
                break;
            case 5:
                $this->setCreatedAt($value);
                break;
            case 6:
                $this->setUpdatedAt($value);
                break;
        } // switch()
    }
1307380
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setFile($value);
                break;
            case 2:
                $this->setPersonId($value);
                break;
            case 3:
                $this->setVisible($value);
                break;
            case 4:
                $this->setPosition($value);
                break;
            case 5:
                $this->setCreatedAt($value);
                break;
            case 6:
                $this->setUpdatedAt($value);
                break;
        } // switch()
    }
75631
public function execute(array $args = [], array $options = [])
    {
        $path = getcwd().'/README.md';

        $this->writeln($this->replaceVars("Project <info>{{project_name}}</info> <comment>({{project_group}})</comment>", $this->getConfig()));
        $this->writeln();

        if (is_file($path)) {
            readfile($path);
        }
    }
340954
public function getArg($pos = null)
    {
        if ($pos === null) {
            return $this->args;
        }

        return isset($this->args[$pos]) ? $this->args[$pos] : $this->args;
    }
355431
public function handle(Args $args, IO $io)
    {
        $updateStrategy = new PuliStrategy();
        $updateStrategy->setStability($this->getStability($args));

        // false: disable signed releases, otherwise the updater will look for
        // a *.pubkey file for the PHAR
        $updater = new Updater(null, false);
        $updater->setStrategyObject($updateStrategy);

        if ($updater->update()) {
            $io->writeLine(sprintf(
                'Updated from version %s to version %s.',
                $updater->getOldVersion(),
                $updater->getNewVersion()
            ));

            return 0;
        }

        $io->writeLine(sprintf(
            'Version %s is the latest version. No update required.',
            $updater->getOldVersion()
        ));

        return 0;
    }