From 3080244c0bcad4c9b70def823acf8f963b4975ce Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Thu, 21 May 2015 14:54:41 +0100 Subject: [PATCH] Rename migrate_to_labels -> migrate-to-labels Signed-off-by: Aanand Prasad --- compose/cli/docopt_command.py | 2 ++ compose/cli/main.py | 4 ++-- compose/service.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compose/cli/docopt_command.py b/compose/cli/docopt_command.py index 8105d3b3f..ee6947012 100644 --- a/compose/cli/docopt_command.py +++ b/compose/cli/docopt_command.py @@ -33,6 +33,8 @@ class DocoptCommand(object): if command is None: raise SystemExit(getdoc(self)) + command = command.replace('-', '_') + if not hasattr(self, command): raise NoSuchCommand(command, self) diff --git a/compose/cli/main.py b/compose/cli/main.py index a2dca65db..cf7d83114 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -99,7 +99,7 @@ class TopLevelCommand(Command): start Start services stop Stop services up Create and start containers - migrate_to_labels Recreate containers to add labels + migrate-to-labels Recreate containers to add labels """ def docopt_options(self): @@ -493,7 +493,7 @@ class TopLevelCommand(Command): """ Recreate containers to add labels - Usage: migrate_to_labels + Usage: migrate-to-labels """ migration.migrate_project_to_labels(project) diff --git a/compose/service.py b/compose/service.py index 7e2bca244..e10758574 100644 --- a/compose/service.py +++ b/compose/service.py @@ -789,7 +789,7 @@ def check_for_legacy_containers( "labels. As of compose 1.3.0 containers are identified with " "labels instead of naming convention. If you'd like compose " "to use this container, please run " - "`docker-compose migrate_to_labels`" % (name,)) + "`docker-compose migrate-to-labels`" % (name,)) def parse_restart_spec(restart_config):