()
| 98 | |
| 99 | |
| 100 | def 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.", |
no test coverage detected