Make a command line argument parser.
()
| 229 | |
| 230 | |
| 231 | def make_parser(): |
| 232 | """ |
| 233 | Make a command line argument parser. |
| 234 | """ |
| 235 | parser = argparse.ArgumentParser( |
| 236 | usage="%(prog)s [OPTIONS] DEST_DIR") |
| 237 | |
| 238 | parser.add_argument( |
| 239 | '--version', action='version', version=nodeenv_version) |
| 240 | |
| 241 | parser.add_argument( |
| 242 | '-n', '--node', dest='node', metavar='NODE_VER', default=Config.node, |
| 243 | help='The node.js version to use, e.g., ' |
| 244 | '--node=0.4.3 will use the node-v0.4.3 ' |
| 245 | 'to create the new environment. ' |
| 246 | 'The default is last stable version (`latest`). ' |
| 247 | 'Use `lts` to use the latest LTS release. ' |
| 248 | 'Use `system` to use system-wide node.') |
| 249 | |
| 250 | parser.add_argument( |
| 251 | '--mirror', |
| 252 | action="store", dest='mirror', default=Config.mirror, |
| 253 | help='Set mirror server of nodejs.org to download from.') |
| 254 | |
| 255 | if not is_WIN: |
| 256 | parser.add_argument( |
| 257 | '-j', '--jobs', dest='jobs', default=Config.jobs, |
| 258 | help='Sets number of parallel commands at node.js compilation. ' |
| 259 | 'The default is 2 jobs.') |
| 260 | |
| 261 | parser.add_argument( |
| 262 | '--load-average', dest='load_average', |
| 263 | help='Sets maximum load average for executing parallel commands ' |
| 264 | 'at node.js compilation.') |
| 265 | |
| 266 | parser.add_argument( |
| 267 | '--without-ssl', dest='without_ssl', |
| 268 | action='store_true', default=Config.without_ssl, |
| 269 | help='Build node.js without SSL support') |
| 270 | |
| 271 | parser.add_argument( |
| 272 | '--debug', dest='debug', |
| 273 | action='store_true', default=Config.debug, |
| 274 | help='Build debug variant of the node.js') |
| 275 | |
| 276 | parser.add_argument( |
| 277 | '--profile', dest='profile', |
| 278 | action='store_true', default=Config.profile, |
| 279 | help='Enable profiling for node.js') |
| 280 | |
| 281 | parser.add_argument( |
| 282 | '--make', '-m', dest='make_path', |
| 283 | metavar='MAKE_PATH', |
| 284 | help='Path to make command', |
| 285 | default=Config.make) |
| 286 | |
| 287 | parser.add_argument( |
| 288 | '--source', dest='prebuilt', |