| 203 | } |
| 204 | |
| 205 | def _process_url(self): |
| 206 | if self.args.url.startswith('://'): |
| 207 | # Paste URL & add space shortcut: `http ://pie.dev` → `http://pie.dev` |
| 208 | self.args.url = self.args.url[3:] |
| 209 | if not URL_SCHEME_RE.match(self.args.url): |
| 210 | if os.path.basename(self.env.program_name) == 'https': |
| 211 | scheme = 'https://' |
| 212 | else: |
| 213 | scheme = self.args.default_scheme + '://' |
| 214 | |
| 215 | # See if we're using curl style shorthand for localhost (:3000/foo) |
| 216 | shorthand = re.match(r'^:(?!:)(\d*)(/?.*)$', self.args.url) |
| 217 | if shorthand: |
| 218 | port = shorthand.group(1) |
| 219 | rest = shorthand.group(2) |
| 220 | self.args.url = scheme + 'localhost' |
| 221 | if port: |
| 222 | self.args.url += ':' + port |
| 223 | self.args.url += rest |
| 224 | else: |
| 225 | self.args.url = scheme + self.args.url |
| 226 | |
| 227 | def _setup_standard_streams(self): |
| 228 | """ |