Rename pw_cmd to pw_cli

This renames pw_cmd to pw_cli, since our plan is for the cli module to
contain general command line interface related tooling, rather than just
the pw_cmd itself.

Change-Id: I1dc7185db25b89d725601ac5d47e0793ea907bf1
diff --git a/pw_cmd/README.md b/pw_cli/README.md
similarity index 100%
rename from pw_cmd/README.md
rename to pw_cli/README.md
diff --git a/pw_cmd/py/pw_cmd/__init__.py b/pw_cli/py/pw_cli/__init__.py
similarity index 94%
rename from pw_cmd/py/pw_cmd/__init__.py
rename to pw_cli/py/pw_cli/__init__.py
index a6aa981..4b812ae 100644
--- a/pw_cmd/py/pw_cmd/__init__.py
+++ b/pw_cli/py/pw_cli/__init__.py
@@ -13,5 +13,5 @@
 # the License.
 
 # Note that these imports will trigger plugin registrations.
-import pw_cmd.log
-import pw_cmd.watch
+import pw_cli.log
+import pw_cli.watch
diff --git a/pw_cmd/py/pw_cmd/__main__.py b/pw_cli/py/pw_cli/__main__.py
similarity index 94%
rename from pw_cmd/py/pw_cmd/__main__.py
rename to pw_cli/py/pw_cli/__main__.py
index 93a366f..8eefaba 100644
--- a/pw_cmd/py/pw_cmd/__main__.py
+++ b/pw_cli/py/pw_cli/__main__.py
@@ -26,8 +26,8 @@
 import importlib
 import pkgutil
 
-import pw_cmd.log
-from pw_cmd.color import Color
+import pw_cli.log
+from pw_cli.color import Color
 
 _LOG = logging.getLogger(__name__)
 
@@ -44,7 +44,7 @@
         raw_args = sys.argv[1:]
 
     # TODO(keir): Add support for configurable logging levels.
-    pw_cmd.log.install()
+    pw_cli.log.install()
 
     # Start with the most critical part of the Pigweed command line tool.
     print(Color.magenta(_PIGWEED_BANNER))
@@ -57,7 +57,7 @@
     parser.add_argument('--loglevel', default='INFO')
 
     # Default command is 'help'
-    pw_cmd.plugins.register(
+    pw_cli.plugins.register(
         name='help',
         help='Show the Pigweed CLI help',
         command_function=parser.print_help,
@@ -69,7 +69,7 @@
     # Find and load registered command line plugins.
     #
     # Plugins are located by finding modules starting with "pw_", and importing
-    # them. On import, modules must call pw_cmd.plugins.register(), which adds
+    # them. On import, modules must call pw_cli.plugins.register(), which adds
     # that plugin to the registry.
     #
     # Note: We may want to make plugin loading explicit rather than doing this
@@ -81,7 +81,7 @@
 
     # Pull plugins out of the registry and set them up with the parser.
     subparsers = parser.add_subparsers(help='pw subcommand to run')
-    for command in pw_cmd.plugins.registry:
+    for command in pw_cli.plugins.registry:
         subparser = subparsers.add_parser(command.name, help=command.help)
         command.define_args_function(subparser)
         subparser.set_defaults(_command=command.command_function)
diff --git a/pw_cmd/py/pw_cmd/color.py b/pw_cli/py/pw_cli/color.py
similarity index 100%
rename from pw_cmd/py/pw_cmd/color.py
rename to pw_cli/py/pw_cli/color.py
diff --git a/pw_cmd/py/pw_cmd/log.py b/pw_cli/py/pw_cli/log.py
similarity index 93%
rename from pw_cmd/py/pw_cmd/log.py
rename to pw_cli/py/pw_cli/log.py
index 10b601e..7e650b4 100644
--- a/pw_cmd/py/pw_cmd/log.py
+++ b/pw_cli/py/pw_cli/log.py
@@ -14,8 +14,8 @@
 
 import logging
 
-import pw_cmd.plugins
-from pw_cmd.color import Color as _Color
+import pw_cli.plugins
+from pw_cli.color import Color as _Color
 
 _LOG = logging.getLogger(__name__)
 
@@ -52,9 +52,9 @@
 
 
 # Note: normally this shouldn't be done at the top level without a try/catch
-# around the pw_cmd.plugins registry import, since pw_cmd might not be
+# around the pw_cli.plugins registry import, since pw_cli might not be
 # installed.
-pw_cmd.plugins.register(
+pw_cli.plugins.register(
     name='logdemo',
     help='Show how how logs look at various levels',
     command_function=main,
diff --git a/pw_cmd/py/pw_cmd/plugins.py b/pw_cli/py/pw_cli/plugins.py
similarity index 100%
rename from pw_cmd/py/pw_cmd/plugins.py
rename to pw_cli/py/pw_cli/plugins.py
diff --git a/pw_cmd/py/pw_cmd/watch.py b/pw_cli/py/pw_cli/watch.py
similarity index 98%
rename from pw_cmd/py/pw_cmd/watch.py
rename to pw_cli/py/pw_cli/watch.py
index b12b8d3..c097077 100755
--- a/pw_cmd/py/pw_cmd/watch.py
+++ b/pw_cli/py/pw_cli/watch.py
@@ -27,8 +27,8 @@
 from watchdog.utils import has_attribute
 from watchdog.utils import unicode_paths
 
-import pw_cmd.plugins
-from pw_cmd.color import Color as _Color
+import pw_cli.plugins
+from pw_cli.color import Color as _Color
 
 import logging
 _LOG = logging.getLogger(__name__)
@@ -302,7 +302,7 @@
 
     observer.join()
 
-pw_cmd.plugins.register(
+pw_cli.plugins.register(
     name='watch',
     help='Watch files for changes',
     define_args_function=add_parser_arguments,
diff --git a/pw_cmd/py/setup.py b/pw_cli/py/setup.py
similarity index 90%
rename from pw_cmd/py/setup.py
rename to pw_cli/py/setup.py
index 660222a..ab83c7d 100644
--- a/pw_cmd/py/setup.py
+++ b/pw_cli/py/setup.py
@@ -12,19 +12,19 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
-"""pw_cmd"""
+"""pw_cli"""
 
 import unittest
 import setuptools
 
 
 def test_suite():
-    """Test suite for pw_cmd module."""
+    """Test suite for pw_cli module."""
     return unittest.TestLoader().discover('./', pattern='*_test.py')
 
 
 setuptools.setup(
-        name='pw_cmd',
+        name='pw_cli',
         version='0.0.1',
         author='Pigweed Authors',
         author_email='pigweed-developers@googlegroups.com',
@@ -33,7 +33,7 @@
         test_suite='setup.test_suite',
         entry_points={
             'console_scripts': [
-                'pw = pw_cmd.__main__:main'
+                'pw = pw_cli.__main__:main'
             ]
         },
         install_requires=[
diff --git a/pw_cmd/requirements.txt b/pw_cli/requirements.txt
similarity index 100%
rename from pw_cmd/requirements.txt
rename to pw_cli/requirements.txt
diff --git a/pw_unit_test/py/pw_unit_test/test_runner.py b/pw_unit_test/py/pw_unit_test/test_runner.py
index 9076afa..df42746 100644
--- a/pw_unit_test/py/pw_unit_test/test_runner.py
+++ b/pw_unit_test/py/pw_unit_test/test_runner.py
@@ -334,9 +334,9 @@
     find_and_run_tests(argv_copy, **kwargs)
 
 try:
-    import pw_cmd.plugins
+    import pw_cli.plugins
 
-    pw_cmd.plugins.register(
+    pw_cli.plugins.register(
         name='test',
         help='Runs groups of unit tests on a target',
         command_function=run_as_plugin,