Permalink
Browse files

docs and colors

  • Loading branch information...
1 parent 0036547 commit 77c5b9e9858f6d6ee83e77c62fb30ac217c705b0 @bahamas10 committed Jan 18, 2013
Showing with 17 additions and 21 deletions.
  1. +13 −17 README.md
  2. +4 −4 bin/musicnamer.js
View
@@ -38,11 +38,11 @@ Examples
To invoke `musicnamer`, simply pass a file over the command line as an argument
dave @ [ bahamas10 :: (SunOS) ] ~ $ musicnamer somesong.mp3
- Error reading /home/dave/.musicnamer.json -- invoke with --init to create this file
+ warn: error reading /home/dave/.musicnamer.json, running with default config
+ warn: invoke with --init to create the config file
- ----- processing somesong.mp3 -----
-
- Moving: somesong.mp3
+ processing: somesong.mp3
+ moving: /home/dave/somesong.mp3
-> To: BEING/Arrival/12 - The Singularity (Cosmists II).mp3
Music namer renamed the file for us. What effectively happened here is this
@@ -55,7 +55,7 @@ We can see the error message above complaining because the config file was not f
unreadable. We can fix this warning with this:
dave @ [ bahamas10 :: (SunOS) ] ~ $ musicnamer --init
- Writing config to /home/dave/.musicnamer.json
+ writing config to /home/dave/.musicnamer.json
More details on the configuration file can be found in the `Configuration` section below.
@@ -64,22 +64,19 @@ them without testing. You can run `musicnamer` with a dry run option to show wh
*would* have been taken.
dave @ [ bahamas10 :: (SunOS) ] ~ $ musicnamer --dry-run somesong.mp3
- ----- processing somesong.mp3 -----
-
- Moving: somesong.mp3
- -> To: BEING/Arrival/12 - The Singularity (Cosmists II).mp3
- No action taken
+ moving: somesong.mp3
+ -> to: BEING/Arrival/12 - The Singularity (Cosmists II).mp3
+ no action taken
As you can see, the warning message no longer shows because we have created a config file.
Also, `musicnamer` just printed out what it would have done, but didn't actually call rename(2)
-on any of the files.
+on any of the files or make any new directories.
You can also test out files to get a glimpse into how `musicnamer` sees your files. There is a
command line switch to have `musicnamer` print out the tags of files without renaming them.
dave @ [ bahamas10 :: (SunOS) ] ~ $ musicnamer --tags music/*.mp3
- ----- processing song1.mp3 -----
-
+ processing: song.mp3
{ title: 'Stimulus',
artist: [ 'The Omega Experiment' ],
albumartist: [],
@@ -91,9 +88,7 @@ command line switch to have `musicnamer` print out the tags of files without ren
picture:
[ { format: '浩条⽥灪来cover\u0000',
data: <Buffer 00 ff db 00 43 00 02 01 01 01 01 01 02 01 01 01 02 02 02 02 02 04 03 02 02 02 02 05 04 04 03 04 06 05 06 06 06 05 06 06 06 07 09 08 06 07 09 07 06 06 08 ...> } ] }
-
- ----- processing song2.mp3 -----
-
+ processing: song2.mp3
{ title: 'Motion',
artist: [ 'The Omega Experiment' ],
albumartist: [],
@@ -109,7 +104,6 @@ command line switch to have `musicnamer` print out the tags of files without ren
This output is good to look for debugging information, without making
any modifications to the filesystem.
-
Configuration
-------------
@@ -132,6 +126,8 @@ Possible options for variables are:
* `:title`: track title
* `:ext`: file extension
+Format can also be passed in from the command line like: `--format 'format string'`
+
Installation
------------
View
@@ -147,18 +147,18 @@ if (!format) {
try {
config = require(configfile);
} catch (e) {
- console.error('warn: error reading '.yellow + configfile.cyan +
+ console.error('warn:'.cyan + ' error reading '.yellow + configfile.green +
', running with default config'.yellow);
- console.error('invoke with '.yellow + '--init'.cyan +
- ' to create the config file'.yellow);
+ console.error('warn:'.cyan + ' invoke with '.yellow + '--init'.green +
+ ' to create the config file\n'.yellow);
}
}
// Loop over the file arguments
files.forEach(function(file) {
var parser = new musicmetadata(fs.createReadStream(file));
parser.on('metadata', function(meta) {
- console.log('processing: %s'.cyan, file.green);
+ console.log('processing: %s'.cyan, path.basename(file).green);
meta.filename = file;
// Only print the tags if --tags is supplied

0 comments on commit 77c5b9e

Please sign in to comment.