/** * Retrieve the script's supported arguments. * * @return array */ public function defaultArguments() { static $arguments; if ($arguments === null) { $validateLanguages = function ($response) { if (strlen($response) === 0) { return true; } try { $this->parseAsArray($response); } catch (Exception $e) { unset($e); return false; } return true; }; $validateLanguages = $validateLanguages->bindTo($this); $validatePaths = function ($response) { if (strlen($response) === 0) { return true; } try { $this->processMultiplePaths($response); } catch (Exception $e) { unset($e); return false; } return true; }; $validatePaths = $validatePaths->bindTo($this); $validateCatalog = function ($response) { if (strlen($response) === 0) { return true; } try { $this->filterWritablePath($response); } catch (Exception $e) { unset($e); return false; } return true; }; $validateCatalog = $validateCatalog->bindTo($this); $arguments = ['max_depth' => ['longPrefix' => 'max-depth', 'castTo' => 'int', 'description' => 'Descend at most the given number of levels of directories. ' . 'A negative value means no limit.', 'defaultValue' => static::DEFAULT_MAX_DEPTH, 'prompt' => 'Scan Depth (of directories)', 'acceptValue' => function ($response) { return strlen($response) === 0 || is_numeric($response); }], 'base_path' => ['prefix' => 'b', 'longPrefix' => 'base', 'required' => true, 'description' => 'Specify an alternate base path.', 'defaultValue' => $this->basePath(), 'prompt' => 'Base Path', 'acceptValue' => function ($response) { return strlen($response) === 0 || is_dir($response); }], 'included_paths' => ['prefix' => 'i', 'longPrefix' => 'include', 'required' => true, 'description' => 'Paths to search for source files (glob patterns).', 'defaultValue' => implode(', ', $this->defaultIncludedPaths()), 'prompt' => 'Included Paths', 'acceptValue' => $validatePaths], 'excluded_paths' => ['prefix' => 'x', 'longPrefix' => 'exclude', 'description' => 'Paths to ignore among the included paths (glob patterns).', 'defaultValue' => implode(', ', $this->defaultExcludedPaths()), 'prompt' => 'Excluded Paths (within included paths)', 'acceptValue' => $validatePaths], 'output_path' => ['prefix' => 'o', 'longPrefix' => 'output-path', 'required' => true, 'description' => 'Where the translatable strings are saved to.', 'defaultValue' => $this->defaultOutputPath(), 'prompt' => 'Store translatable text in', 'acceptValue' => $validateCatalog], 'source_language' => ['prefix' => 's', 'longPrefix' => 'source-language', 'required' => true, 'description' => 'The language in which the text in the source code is written.', 'defaultValue' => $this->sourceLanguage(), 'prompt' => 'Source Language'], 'merge_languages' => ['longPrefix' => 'merge-languages', 'description' => 'How to resolve unexpected languages from the translations file.', 'defaultValue' => static::DEFAULT_LANGUAGE_MERGE, 'prompt' => 'How to handle unexpected languages from the translations file?', 'inputType' => 'radio', 'options' => $this->supportedLanguageMergeStrategies()], 'languages' => ['prefix' => 'l', 'longPrefix' => 'languages', 'required' => true, 'description' => 'The languages the text will be translated to.', 'defaultValue' => implode(', ', $this->languages()), 'prompt' => 'Languages to translate into', 'acceptValue' => $validateLanguages]]; } return array_merge(parent::defaultArguments(), $arguments); }
/** * Retrieve the script's parent arguments. * * Useful for specialty classes extending this one that might not want * options for selecting specific objects. * * @return array */ public function parentArguments() { return parent::defaultArguments(); }
/** * Retrieve the available default arguments of this action. * * @link http://climate.thephpleague.com/arguments/ For descriptions of the options for CLImate. * * @return array */ public function defaultArguments() { $arguments = ['username' => ['prefix' => 'u', 'longPrefix' => 'username', 'description' => 'The user name'], 'email' => ['prefix' => 'e', 'longPrefix' => 'email', 'description' => 'The user email'], 'password' => ['prefix' => 'p', 'longPrefix' => 'password', 'description' => 'The user password', 'inputType' => 'password'], 'roles' => ['prefix' => 'r', 'longPrefix' => 'roles', 'description' => 'The user role']]; $arguments = array_merge(parent::defaultArguments(), $arguments); return $arguments; }
/** * @return array */ public function defaultArguments() { $arguments = ['obj-type' => ['longPrefix' => 'obj-type', 'description' => 'Object type', 'defaultValue' => '']]; $arguments = array_merge(parent::defaultArguments(), $arguments); return $arguments; }
/** * Retrieve the available default arguments of this action. * * @link http://climate.thephpleague.com/arguments/ For descriptions of the options for CLImate. * * @return array */ public function defaultArguments() { $arguments = ['username' => ['prefix' => 'u', 'longPrefix' => 'username', 'description' => 'The user name'], 'password' => ['prefix' => 'p', 'longPrefix' => 'password', 'description' => 'The user password', 'inputType' => 'password'], 'sendEmail' => ['longPrefix' => 'send-email', 'description' => 'If true, an email will be sent to the user.', 'noValue' => true, 'defaultValue' => false]]; $arguments = array_merge(parent::defaultArguments(), $arguments); return $arguments; }
/** * @return array */ public function defaultArguments() { $arguments = ['obj-type' => ['longPrefix' => 'obj-type', 'description' => 'Object type. Leave empty to enter it interactively.', 'defaultValue' => ''], 'num' => ['prefix' => 'n', 'longPrefix' => 'num', 'description' => 'Number of objects to retrieve.', 'defaultValue' => 250, 'castTo' => 'int'], 'page' => ['prefix' => 'p', 'longPrefix' => 'page', 'description' => 'Current page. Depends on the number of objects.', 'defaultValue' => 1, 'castTo' => 'int']]; $arguments = array_merge(parent::defaultArguments(), $arguments); return $arguments; }
/** * Valid arguments: * - path : path/to/files * - type : mustache | php * * @return array */ public function defaultArguments() { $arguments = ['path' => ['longPrefix' => 'path', 'description' => 'Path relative to the project installation (ex: templates/*/*/)', 'defaultValue' => ''], 'type' => ['longPrefix' => 'type', 'description' => 'File type (mustache || php)', 'defaultValue' => ''], 'output' => ['longPrefix' => 'output', 'description' => 'Output file path', 'defaultValue' => '']]; $arguments = array_merge(parent::defaultArguments(), $arguments); return $arguments; }