Beispiel #1
0
def setup_argparse():
    parser = argparse.ArgumentParser(
        description=textwrap.dedent('''\
        FeelUOwn - modern music player (daemon).

        Example:
            - fuo                        # start fuo server
            - fuo status                 # lookup server status
            - fuo play "no matter what"  # search and play "no matter what"
        '''),
        formatter_class=argparse.RawTextHelpFormatter)

    setup_cli_argparse(parser)

    parser.add_argument('-d',
                        '--debug',
                        action='store_true',
                        default=False,
                        help='开启调试模式')
    parser.add_argument('-v',
                        '--version',
                        action='store_true',
                        help='显示当前 feeluown 和 fuocore 版本')
    parser.add_argument('-ns',
                        '--no-server',
                        action='store_true',
                        default=False,
                        help='不运行 server')
    parser.add_argument('-nw',
                        '--no-window',
                        action='store_true',
                        default=False,
                        help='不显示 GUI')
    parser.add_argument('--log-to-file',
                        action='store_true',
                        default=False,
                        help='将日志打到文件中')
    parser.add_argument('--force-mac-hotkey',
                        action='store_true',
                        default=False,
                        help='强制开启 mac 全局热键')
    # XXX: 不知道能否加一个基于 regex 的 option?比如加一个
    # `--mpv-*` 的 option,否则每个 mpv 配置我都需要写一个 option?

    # TODO: 需要在文档中给出如何查看有哪些播放设备的方法
    parser.add_argument('--mpv-audio-device',
                        default='auto',
                        help='(高级选项)给 mpv 播放器指定播放设备')
    return parser
Beispiel #2
0
def setup_argparse():
    parser = argparse.ArgumentParser(
        description=textwrap.dedent('''\
        FeelUOwn - modern music player (daemon).

        Example:
            - fuo                        # start fuo server
            - fuo status                 # lookup server status
            - fuo play 晴天-周杰伦       # search and play
        '''),
        formatter_class=argparse.RawTextHelpFormatter,
        prog='feeluown')

    setup_cli_argparse(parser)

    parser.add_argument('-V',
                        '--version',
                        action='version',
                        version='%(prog)s {}'.format(feeluown_version))
    parser.add_argument('-ns',
                        '--no-server',
                        action='store_true',
                        default=False,
                        help='不运行 server')
    parser.add_argument('-nw',
                        '--no-window',
                        action='store_true',
                        default=False,
                        help='不显示 GUI')

    # options about log
    parser.add_argument('-d',
                        '--debug',
                        action='store_true',
                        default=False,
                        help='开启调试模式')
    parser.add_argument('-v', '--verbose', action='count', help='输出详细的日志')
    parser.add_argument('--log-to-file',
                        action='store_true',
                        default=False,
                        help='将日志打到文件中')

    # XXX: 不知道能否加一个基于 regex 的 option?比如加一个
    # `--mpv-*` 的 option,否则每个 mpv 配置我都需要写一个 option?

    # TODO: 需要在文档中给出如何查看有哪些播放设备的方法
    parser.add_argument('--mpv-audio-device', help='(高级选项)指定播放设备')
    return parser