@@ -469,7 +469,9 @@ Command-line interface
469469
470470:mod: `!http.server ` can also be invoked directly using the :option: `-m `
471471switch of the interpreter. The following example illustrates how to serve
472- files relative to the current directory::
472+ files relative to the current directory:
473+
474+ .. code-block :: bash
473475
474476 python -m http.server [OPTIONS] [port]
475477
@@ -480,7 +482,9 @@ The following options are accepted:
480482.. option :: port
481483
482484 The server listens to port 8000 by default. The default can be overridden
483- by passing the desired port number as an argument::
485+ by passing the desired port number as an argument:
486+
487+ .. code-block :: bash
484488
485489 python -m http.server 9000
486490
@@ -489,7 +493,9 @@ The following options are accepted:
489493 Specifies a specific address to which it should bind. Both IPv4 and IPv6
490494 addresses are supported. By default, the server binds itself to all
491495 interfaces. For example, the following command causes the server to bind
492- to localhost only::
496+ to localhost only:
497+
498+ .. code-block :: bash
493499
494500 python -m http.server --bind 127.0.0.1
495501
@@ -502,7 +508,9 @@ The following options are accepted:
502508
503509 Specifies a directory to which it should serve the files. By default,
504510 the server uses the current directory. For example, the following command
505- uses a specific directory::
511+ uses a specific directory:
512+
513+ .. code-block :: bash
506514
507515 python -m http.server --directory /tmp/
508516
@@ -512,15 +520,19 @@ The following options are accepted:
512520
513521 Specifies the HTTP version to which the server is conformant. By default,
514522 the server is conformant to HTTP/1.0. For example, the following command
515- runs an HTTP/1.1 conformant server::
523+ runs an HTTP/1.1 conformant server:
524+
525+ .. code-block :: bash
516526
517527 python -m http.server --protocol HTTP/1.1
518528
519529 .. versionadded :: 3.11
520530
521531.. option :: --tls-cert
522532
523- Specifies a TLS certificate chain for HTTPS connections::
533+ Specifies a TLS certificate chain for HTTPS connections:
534+
535+ .. code-block :: bash
524536
525537 python -m http.server --tls-cert fullchain.pem
526538
@@ -536,7 +548,9 @@ The following options are accepted:
536548
537549.. option :: --tls-password-file
538550
539- Specifies the password file for password-protected private keys::
551+ Specifies the password file for password-protected private keys:
552+
553+ .. code-block :: bash
540554
541555 python -m http.server \
542556 --tls-cert cert.pem \
0 commit comments