mirror of
https://github.com/beetbox/beets.git
synced 2026-02-25 08:45:01 +01:00
CLI options for directory and path format
This commit is contained in:
parent
bae5ca5d70
commit
107bf1bb5e
1 changed files with 11 additions and 5 deletions
16
bts
16
bts
|
|
@ -107,9 +107,13 @@ class BeetsApp(cmdln.Cmdln):
|
|||
# Add global options to the command.
|
||||
parser = cmdln.Cmdln.get_optparser(self)
|
||||
parser.add_option('-l', '--library', dest='libpath',
|
||||
help='the library database file to use')
|
||||
parser.add_option('-d', '--device', dest='device',
|
||||
help="the name of the device library to use")
|
||||
help='library database file to use')
|
||||
parser.add_option('-d', '--directory', dest='directory',
|
||||
help="destination music directory")
|
||||
parser.add_option('-p', '--pathformat', dest='path_format',
|
||||
help="destination path format string")
|
||||
parser.add_option('-i', '--device', dest='device',
|
||||
help="name of the device library to use")
|
||||
return parser
|
||||
|
||||
def postoptparse(self):
|
||||
|
|
@ -127,8 +131,10 @@ class BeetsApp(cmdln.Cmdln):
|
|||
else:
|
||||
libpath = self.options.libpath or \
|
||||
self.config.get('beets', 'library')
|
||||
directory = self.config.get('beets', 'directory')
|
||||
path_format = self.config.get('beets', 'path_format')
|
||||
directory = self.options.directory or \
|
||||
self.config.get('beets', 'directory')
|
||||
path_format = self.options.path_format or \
|
||||
self.config.get('beets', 'path_format')
|
||||
self.lib = Library(os.path.expanduser(libpath),
|
||||
directory,
|
||||
path_format)
|
||||
|
|
|
|||
Loading…
Reference in a new issue