MCPcopy Index your code
hub / github.com/idank/explainshell / main

Function main

tools/fetch_manned.py:704–779  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

702
703
704def main():
705 parser = argparse.ArgumentParser(
706 description="Fetch man pages from manned.org database dump"
707 )
708 parser.add_argument(
709 "--log",
710 default="INFO",
711 help="Log level (default: INFO)",
712 )
713 subparsers = parser.add_subparsers(dest="command", required=True)
714
715 # download subcommand
716 dl_parser = subparsers.add_parser(
717 "download",
718 help="Download dump files from manned.org",
719 )
720 dl_parser.add_argument(
721 "--dump-url",
722 default=None,
723 help="Full URL to dump directory (e.g. https://dl.manned.org/2026-02-21). "
724 "Auto-resolves from 'current' pointer if not specified.",
725 )
726 dl_parser.add_argument(
727 "--data-dir",
728 default=DEFAULT_DATA_DIR,
729 help=f"Directory to store dump files (default: {DEFAULT_DATA_DIR})",
730 )
731
732 # extract subcommand
733 ex_parser = subparsers.add_parser(
734 "extract",
735 help="Extract man pages from downloaded dump files",
736 )
737 ex_parser.add_argument(
738 "--data-dir",
739 default=DEFAULT_DATA_DIR,
740 help=f"Directory containing dump files (default: {DEFAULT_DATA_DIR})",
741 )
742 ex_parser.add_argument(
743 "--output-dir",
744 "-o",
745 default="manpages",
746 help="Output directory for .gz man page files (default: manpages)",
747 )
748 ex_parser.add_argument(
749 "--distro",
750 "-d",
751 default="ubuntu",
752 help="Distribution to extract man pages from (default: ubuntu). "
753 "Matched case-insensitively against system names.",
754 )
755 ex_parser.add_argument(
756 "--release",
757 "-r",
758 default="latest",
759 help="Distribution release version to extract (e.g. '24.04'). "
760 "Default: 'latest' (auto-selects the newest release).",
761 )

Callers 1

fetch_manned.pyFile · 0.70

Calls 2

cmd_downloadFunction · 0.85
cmd_extractFunction · 0.85

Tested by

no test coverage detected