Repository: beetbox/beets

Issue:
Beets shows the wrong config file in verbose mode when it is specified from the command line
### Problem

Running this command in verbose (`-vv`) mode:

``` sh
$ beet -vv -c /home/jack/Music/config.yaml ls
user configuration: /home/jack/.config/beets/config.yaml
data directory: /home/jack/.config/beets
plugin paths: 
Sending event: pluginload
library database: /home/jack/Music/library.blb
library directory: /home/jack/Music
Sending event: library_opened
Sending event: cli_exit
```

(`beet ls` doesn't output anything because this testing library is empty)
The issue is not beets loading the wrong config file. I verified this by turning off colour in my test config and doing `beet import`. What each config file is named doesn't affect the issue.
### Setup
- OS: Korora 23
- Python version: 2.7.11
- beets version: 1.3.18
- Turning off plugins made problem go away (yes/no): 
  no 

Main config (in /home/jack/.config/beets/config.yaml):

``` yaml
plugins: fetchart duplicates play web acousticbrainz
directory: /mnt/usb-Seagate_Expansion_Desk_NA4M79J2-0:0-part1/Musak
library: /mnt/usb-Seagate_Expansion_Desk_NA4M79J2-0:0-part1/Musak/newLibrary.blb
import:
    move: yes
per_disc_numbering: yes 

paths:
    default: $albumartist/$album%aunique{}/$disc-$track $title
    singleton: $albumartist/$title
musicbrainz:
    searchlimit: 10

match:
    preferred:
        countries: ['AU']
        media: ['CD', 'Digital Media|File']

```

Test config (in /home/jack/Music/config.yaml):

``` yaml
directory: /home/jack/Music/
library: /home/jack/Music/library.blb
import:
    move: yes
paths:
    default: $albumartist/$album%aunique{}/$disc-$track $title
    singleton: $albumartist/$title

ui:
    color: no
```



Discussion:
By "user configuration", beets means the base config. The -c option lets you add a new overlay on top of your user config, but it doesn't replace it. So I think the debug log is correct. We could also consider adding a new message for the -c overlay if that seems like a good idea.

Ok, that makes sense. It just isn't communicated to the user very well. Adding a message about how configs overlay in the docs and when you specify a config would make it clearer.

I can take a look at doing this if its fine with you. Don't expect a pull request too soon though, as I'm quite busy currently.

Yes, please! More clarity in the docs would be very welcome. Thanks!


Resolving patch:
diff --git a/beets/ui/__init__.py b/beets/ui/__init__.py
--- a/beets/ui/__init__.py
+++ b/beets/ui/__init__.py
@@ -1122,9 +1122,11 @@ def _configure(options):
     # special handling lets specified plugins get loaded before we
     # finish parsing the command line.
     if getattr(options, 'config', None) is not None:
-        config_path = options.config
+        overlay_path = options.config
         del options.config
-        config.set_file(config_path)
+        config.set_file(overlay_path)
+    else:
+        overlay_path = None
     config.set_args(options)
 
     # Configure the logger.
@@ -1133,6 +1135,10 @@ def _configure(options):
     else:
         log.set_global_level(logging.INFO)
 
+    if overlay_path:
+        log.debug(u'overlaying configuration: {0}',
+                  util.displayable_path(overlay_path))
+
     config_path = config.user_config_path()
     if os.path.isfile(config_path):
         log.debug(u'user configuration: {0}',


Test patch: