Sensio\Bundle\GeneratorBundle\Command\GenerateBundleCommand::configure PHP Method

configure() protected method

See also: Command
protected configure ( )
    protected function configure()
    {
        $this
            ->setDefinition(array(
                new InputOption('namespace', '', InputOption::VALUE_REQUIRED, 'The namespace of the bundle to create'),
                new InputOption('dir', '', InputOption::VALUE_REQUIRED, 'The directory where to create the bundle'),
                new InputOption('bundle-name', '', InputOption::VALUE_REQUIRED, 'The optional bundle name'),
                new InputOption('format', '', InputOption::VALUE_REQUIRED, 'Use the format for configuration files (php, xml, yml, or annotation)', 'annotation'),
                new InputOption('structure', '', InputOption::VALUE_NONE, 'Whether to generate the whole directory structure'),
            ))
            ->setDescription('Generates a bundle')
            ->setHelp(<<<EOT
The <info>generate:bundle</info> command helps you generates new bundles.

By default, the command interacts with the developer to tweak the generation.
Any passed option will be used as a default value for the interaction
(<comment>--namespace</comment> is the only one needed if you follow the
conventions):

<info>php app/console generate:bundle --namespace=Acme/BlogBundle</info>

Note that you can use <comment>/</comment> instead of <comment>\\</comment> for the namespace delimiter to avoid any
problem.

If you want to disable any user interaction, use `--no-interaction` but don't
forget to pass all needed options:

<info>php app/console generate:bundle --namespace=Acme/BlogBundle --dir=src [--bundle-name=...] --no-interaction</info>

Note that the bundle namespace must end with "Bundle".
EOT
            )
            ->setName('generate:bundle')
        ;
    }

Usage Example

    protected function configure()
    {
        parent::configure();
        $this->setName('rollerworks:multi-user:generate:usersys');
        $definition = $this->getDefinition();
        $definition->addOption(new InputOption('db-driver', '', InputOption::VALUE_REQUIRED, 'DB-driver to use'));
        $this->setHelp(<<<EOT
The <info>rollerworks:multi-user:generate:usersys</info> command helps you generates new user-system bundles.

By default, the command interacts with the developer to tweak the generation.
Any passed option will be used as a default value for the interaction
(<comment>--namespace</comment> is the only one needed if you follow the
conventions):

<info>php app/console rollerworks:multi-user:generate:usersys --namespace=Acme/UserBundle</info>

Note that you can use <comment>/</comment> instead of <comment>\\ </comment>for the namespace delimiter to avoid any
problem.

If you want to disable any user interaction, use <comment>--no-interaction</comment> but don't forget to pass all needed options:

<info>php app/console rollerworks:multi-user:generate:usersys --namespace=Acme/UserBundle --dir=src [--db-driver=...] [--bundle-name=...] --no-interaction</info>

Note that the bundle namespace must end with "Bundle".
EOT
);
    }
All Usage Examples Of Sensio\Bundle\GeneratorBundle\Command\GenerateBundleCommand::configure