chg: dev: add main module.

This commit is contained in:
rachmadaniHaryono 2017-02-24 10:18:56 +08:00
parent 77a6b0edf8
commit b1ee9716bf
2 changed files with 16 additions and 0 deletions

6
beets/__main__.py Normal file
View file

@ -0,0 +1,6 @@
"""main module."""
import sys
from .ui import main
if __name__ == "__main__":
main(sys.argv[1:])

View file

@ -946,6 +946,16 @@ class SubcommandsOptionParser(CommonOptionsParser):
self.subcommands = []
def get_prog_name(self):
"""Get program name.
Returns:
Program name.
"""
prog_name = super(SubcommandsOptionParser, self).get_prog_name()
prog_name = 'beets' if prog_name == '__main__.py' else prog_name
return prog_name
def add_subcommand(self, *cmds):
"""Adds a Subcommand object to the parser's list of commands.
"""