zshの補完関数が理解できない
symfony1.1の補完関数書こうとしたら、コロン以降が補完されず投げそう。
symfony本家のtracにあるzsh Completion fileの_1st_argumentsを以下のように変更して
_1st_arguments=( 'help:Displays help for a task' 'h:Displays help for a task' 'list:List tasks' 'cc:Clears the cache' 'cache\:clear:Clears the cache' 'configure\:author:Configure project author' 'configure\:database:Configure database DSN' 'generate\:app:Generates a new application' 'generate\:module:Generates a new module' 'generate\:project:Generates a new project' 'generate\:task:Creates a skeleton class for a new task' 'i18n\:extract:Extracts i18n strings from php files' 'i18n\:find:Finds non "i18n ready" strings in an application' 'log\:clear:Clears log files' 'log\:rotatei:Rotates an application log files' 'plugin\:add-channel:Add a new PEAR channel' 'plugin\:install:Installs a plugin' 'plugin\:list:Lists installed plugins' 'plugin\:uninstall:Uninstalls a plugin' 'plugin\:upgrade:Upgrades a plugin' 'project\:clear-controllers:Clears all non production environment controllers' 'project\:deploy:Deploys a project to another server' 'sync:Deploys a project to another server' 'project\:disable:Disables an application in a given environment' 'disable:Disables an application in a given environment' 'project\:enable:Enables an application in a given environment' 'enable:Enables an application in a given environment' 'project\:freeze:Freezes symfony libraries' 'freeze:Freezes symfony libraries' 'project\:permissions:Fixes symfony directory permissions' 'permissions:Fixes symfony directory permissions' 'project\:unfreeze:Unfreezes symfony libraries' 'unfreeze:Unfreezes symfony libraries' 'project\:upgrade1.1:Upgrade a symfony project to the 1.1 symfony release' 'propel\:build-all:Generates Propel model, SQL and initializes the database' 'propel\:build-all-load:Generates Propel model, SQL, initializes database, and load data' 'propel\:build-db:Creates database for current model' 'propel\:build-forms:Creates form classes for the current model' 'propel\:build-model:Creates classes for the current model' 'propel\:build-schema:Creates a schema.xml from an existing database' 'propel\:build-sql:Creates SQL for the current model' 'propel\:data-dump:Dumps data to the fixtures directory' 'propel\:data-load:Loads data from fixtures directory' 'propel\:generate-crud:Generates a Propel CRUD module' 'propel\:init-admin:Initializes a Propel admin module' 'propel\:insert-sql:Inserts SQL for current model' 'propel\:schema-to-xml:Creates schema.xml from schema.yml' 'propel\:schema-to-yml:Creates schema.yml from schema.xml' 'test\:all:Launches all tests' 'test\:functional:Launches functional tests' 'test\:unit:Launches unit tests' )
いざ補完!
colinux /home/takitake% symfony p symfony commands plugin:add-channel -- Add a new PEAR channel plugin:install -- Installs a plugin plugin:list -- Lists installed plugins plugin:uninstall -- Uninstalls a plugin plugin:upgrade -- Upgrades a plugin project:clear-controllers -- Clears all non production environme project:deploy -- Deploys a project to another server project:disable -- Disables an application in a given project:enable -- Enables an application in a given e project:freeze -- Freezes symfony libraries project:permissions permissions -- Fixes symfony directory permissions project:unfreeze -- Unfreezes symfony libraries project:upgrade1.1 -- Upgrade a symfony project to the 1. propel:build-all -- Generates Propel model, SQL and ini propel:build-all-load -- Generates Propel model, SQL, initia propel:build-db -- Creates database for current model propel:build-forms -- Creates form classes for the curren propel:build-model -- Creates classes for the current mod propel:build-schema -- Creates a schema.xml from an existi propel:build-sql -- Creates SQL for the current model propel:data-dump -- Dumps data to the fixtures director propel:data-load -- Loads data from fixtures directory propel:generate-crud -- Generates a Propel CRUD module propel:init-admin -- Initializes a Propel admin module propel:insert-sql -- Inserts SQL for current model propel:schema-to-xml -- Creates schema.xml from schema.yml propel:schema-to-yml -- Creates schema.yml from schema.xml
おおいい感じ
colinux /home/takitake% symfony project: No matches for: `symfony commands'
コロンまで補完したら、no matches
いや、あるから!