diff --git a/docs/api/backends.rst b/docs/api/backends.rst index a85feb03..ec78f250 100644 --- a/docs/api/backends.rst +++ b/docs/api/backends.rst @@ -39,11 +39,6 @@ Library provider .. autoclass:: mopidy.backends.base.BaseLibraryProvider :members: -Sub-command provider -==================== - -.. autoclass:: mopidy.backends.base.BaseSubCommandProvider - :members: Backend listener ================ diff --git a/docs/changelog.rst b/docs/changelog.rst index 717a6aaa..c394f2b4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -74,13 +74,12 @@ v0.17.0 (UNRELEASED) ===================== ================= Old command New command ===================== ================= - mopidy mopidy mopidy --show-deps mopidy deps mopidy --show-config mopidy config mopidy-scan mopidy local scan - Added hooks for extensions to create their own custom sub-commands and - converted ``mopidy-scan`` as first user of new API (Fixes :issue:`436`). + converted ``mopidy-scan`` as first user of new API. (Fixes :issue:`436`) v0.16.1 (2013-11-02) diff --git a/docs/commands/mopidy.rst b/docs/commands/mopidy.rst index e133c0f6..8f5e41d5 100644 --- a/docs/commands/mopidy.rst +++ b/docs/commands/mopidy.rst @@ -62,12 +62,8 @@ Options be provided multiple times. -Built in sub-commands -===================== - -.. cmdoption:: run - - Run the mopidy server. +Built in commands +================= .. cmdoption:: config @@ -80,15 +76,14 @@ Built in sub-commands Show dependencies, their versions and installation location. -Extension sub-commands -====================== +Extension commands +================== -Additionally, extensions can provide extra sub-commands. See ``mopidy --help`` -for a list of what is available on your system and ``mopidy COMMAND --help`` -for command-specific help. Sub-commands for disabled extensions will be listed, -but can not be run. +Additionally, extensions can provide extra commands. See ``mopidy --help`` +for a list of what is available on your system and command-specific help. +Commands for disabled extensions will be listed, but can not be run. -.. cmdoption:: local +.. cmdoption:: local scan Scan local media files present in your library. @@ -114,19 +109,19 @@ To start the music server, run:: To start the server with an additional config file than can override configs set in the default config files, run:: - mopidy --config ./my-config.conf run + mopidy --config ./my-config.conf To start the server and change a config value directly on the command line, run:: - mopidy --option mpd/enabled=false run + mopidy --option mpd/enabled=false The :option:`--option` flag may be repeated multiple times to change multiple configs:: - mopidy -o mpd/enabled=false -o spotify/bitrate=320 run + mopidy -o mpd/enabled=false -o spotify/bitrate=320 -``mopidy config`` output shows the effect of the :option:`--option` flags:: +The ``mopidy config`` output shows the effect of the :option:`--option` flags:: mopidy -o mpd/enabled=false -o spotify/bitrate=320 config diff --git a/docs/ext/local.rst b/docs/ext/local.rst index 45680633..23baa5d1 100644 --- a/docs/ext/local.rst +++ b/docs/ext/local.rst @@ -71,7 +71,7 @@ music... Generating a tag cache ---------------------- -The program :command:`mopidy local scan` will scan the path set in the +The command :command:`mopidy local scan` will scan the path set in the :confval:`local/media_dir` config value for any media files and build a MPD compatible ``tag_cache``. diff --git a/mopidy/backends/local/command.py b/mopidy/backends/local/command.py index dcabe6cf..58746cf0 100644 --- a/mopidy/backends/local/command.py +++ b/mopidy/backends/local/command.py @@ -10,7 +10,7 @@ from mopidy.utils import command, path from . import translator -logger = logging.getLogger('mopidy.backends.local.scan') +logger = logging.getLogger('mopidy.backends.local.command') class LocalCommand(command.Command): @@ -20,7 +20,11 @@ class LocalCommand(command.Command): class ScanCommand(command.Command): - """Scan local media files""" + """Scan local media files and populate the local library.""" + + def __init__(self): + super(ScanCommand, self).__init__() + self.add_argument('--limit', type=int, help='number of tracks to scan') def run(self, args, config, extensions): media_dir = config['local']['media_dir'] diff --git a/mopidy/ext.py b/mopidy/ext.py index 118b49ec..9ebc978d 100644 --- a/mopidy/ext.py +++ b/mopidy/ext.py @@ -91,8 +91,7 @@ class Extension(object): """Command to expose to command line users running mopidy. :returns: - Instance of a :class:`~mopidy.utils.command.Command` class - or sub-class. + Instance of a :class:`~mopidy.utils.command.Command` class. """ pass