commands: Review changes for wording etc (#570)

This commit is contained in:
Thomas Adamcik 2013-11-16 02:23:04 +01:00
parent 209a6659f6
commit f89169d551
6 changed files with 21 additions and 29 deletions

View File

@ -39,11 +39,6 @@ Library provider
.. autoclass:: mopidy.backends.base.BaseLibraryProvider
:members:
Sub-command provider
====================
.. autoclass:: mopidy.backends.base.BaseSubCommandProvider
:members:
Backend listener
================

View File

@ -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)

View File

@ -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

View File

@ -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``.

View File

@ -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']

View File

@ -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