@@ -27,6 +27,9 @@ class MigrateCommand extends Command
2727{
2828 private $ factory ;
2929 private $ container ;
30+ private $ actions = array (
31+ 'up ' , 'down ' , 'top ' , 'bottom ' ,
32+ );
3033
3134 public function __construct (
3235 MigratorFactory $ factory ,
@@ -41,8 +44,35 @@ public function __construct(
4144 public function configure ()
4245 {
4346 $ this ->setName ('phpcr:migrations:migrate ' );
44- $ this ->addArgument ('to ' , InputArgument::OPTIONAL , 'Migrate to this version ' );
47+ $ this ->addArgument ('to ' , InputArgument::OPTIONAL , sprintf (
48+ 'Version name to migrate to, or an action: "<comment>%s</comment>" ' ,
49+ implode ('</comment>", "<comment> ' , $ this ->actions )
50+ ));
4551 $ this ->setDescription ('Migrate the content repository between versions ' );
52+ $ this ->setHelp (<<<EOT
53+ Migrate to a specific version or perform an action.
54+
55+ By default it will migrate to the latest version:
56+
57+ $ %command.full_name%
58+
59+ You can migrate to a specific version (either in the "past" or "future"):
60+
61+ $ %command.full_name% 201504011200
62+
63+ Or specify an action
64+
65+ $ %command.full_name% <action>
66+
67+ Action can be one of:
68+
69+ - <comment>up</comment>: Migrate one version up
70+ - <comment>down</comment>: Migrate one version down
71+ - <comment>top</comment>: Migrate to the latest version
72+ - <comment>bottom</comment>: Revert all migrations
73+
74+ EOT
75+ );
4676 }
4777
4878 public function execute (InputInterface $ input , OutputInterface $ output )
0 commit comments