Ejemplo n.º 1
0
def generate_commandline_options():
    """Generate file including the command line options."""
    argparser = parser.get_argparser()
    groups, titles = _get_options(argparser)
    # Synopsis
    filename_synopsis = "docs/manpage/synopsis.rstsrc"
    with open(filename_synopsis, "w") as f:
        synopsis_options = ["[%s]" % (title) for title in titles]
        synopsis = "**vimiv** %s" % (" ".join(synopsis_options))
        f.write(synopsis)
    # Options
    filename_options = "docs/manpage/options.rstsrc"
    with RSTFile(filename_options) as f:
        for title, argstr in groups.items():
            f.write_section(title)
            f.write(argstr)
Ejemplo n.º 2
0
def setup_pre_app(argv: List[str]) -> argparse.Namespace:
    """Early setup that is done before the QApplication is created.

    Includes parsing the command line and setting up logging as well as initializing the
    components that do not require an application.

    Args:
        argv: sys.argv[1:] from the executable or argv passed by test suite.
    """
    args = parser.get_argparser().parse_args(argv)
    if args.version:
        print(version.info(), version.paths(), sep="\n\n")
        sys.exit(customtypes.Exit.success)
    migration.run()
    init_directories(args)
    log.setup_logging(args.log_level, *args.debug)
    _logger.debug("Start: vimiv %s", " ".join(argv))
    update_settings(args)
    trash_manager.init()
    return args
def argparser():
    yield parser.get_argparser()