MCPcopy
hub / github.com/StevenBlack/hosts / main

Function main

updateHostsFile.py:100–349  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99
100def main():
101 parser = argparse.ArgumentParser(
102 description="Creates a unified hosts "
103 "file from hosts stored in the data subfolders."
104 )
105 parser.add_argument(
106 "--auto",
107 "-a",
108 dest="auto",
109 default=False,
110 action="store_true",
111 help="Run without prompting.",
112 )
113 parser.add_argument(
114 "--backup",
115 "-b",
116 dest="backup",
117 default=False,
118 action="store_true",
119 help="Backup the hosts files before they are overridden.",
120 )
121 parser.add_argument(
122 "--extensions",
123 "-e",
124 dest="extensions",
125 default=[],
126 nargs="*",
127 help="Host extensions to include in the final hosts file.",
128 )
129 parser.add_argument(
130 "--nounifiedhosts",
131 dest="nounifiedhosts",
132 default=False,
133 action="store_true",
134 help="Do not include the unified hosts file in the final hosts file. Usually used together with `--extensions`.",
135 )
136 parser.add_argument(
137 "--ip",
138 "-i",
139 dest="targetip",
140 default="0.0.0.0",
141 help="Target IP address. Default is 0.0.0.0.",
142 )
143 parser.add_argument(
144 "--keepdomaincomments",
145 "-k",
146 dest="keepdomaincomments",
147 action="store_false",
148 default=True,
149 help="Do not keep domain line comments.",
150 )
151 parser.add_argument(
152 "--noupdate",
153 "-n",
154 dest="noupdate",
155 default=False,
156 action="store_true",
157 help="Don't update from host data sources.",

Callers 1

updateHostsFile.pyFile · 0.70

Calls 15

path_join_robustFunction · 0.85
get_defaultsFunction · 0.85
list_dir_no_hiddenFunction · 0.85
prompt_for_updateFunction · 0.85
update_all_sourcesFunction · 0.85
prompt_for_exclusionsFunction · 0.85
update_sources_dataFunction · 0.85
create_initial_fileFunction · 0.85
remove_old_hosts_fileFunction · 0.85
remove_dups_and_exclFunction · 0.85
compress_fileFunction · 0.85

Tested by

no test coverage detected