File: sample-directive-special.py

package info (click to toggle)
sphinx-argparse 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 288 kB
  • sloc: python: 1,514; makefile: 133
file content (33 lines) | stat: -rw-r--r-- 830 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import argparse


def get_parser():
    parser = argparse.ArgumentParser(
        prog='sample-directive-special',
        description='Support SphinxArgParse HTML testing (with defaults)',
    )

    parser.add_argument(
        '--some-int',
        help='Regular scalar input with default value',
        default=420,
        type=int,
    )
    parser.add_argument(
        '--some-text',
        help='Scalar text input',
        default='*.rst _txt_ **strong** *italic* ``code``',
    )
    parser.add_argument(
        '--list-text',
        help='List input for some bits of text',
        default=['*.rst', '_txt_', '**strong**', '*italic*', '``code``'],
        nargs='+',
    )
    parser.add_argument(
        '--some-text-empty-default',
        help='Scalar text input',
        default='',
    )

    return parser