Skip to content

Commit 3ad2c3b

Browse files
committed
List long options first
1 parent 16c13fc commit 3ad2c3b

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

sphinx/cmd/build.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -149,67 +149,68 @@ def get_parser() -> argparse.ArgumentParser:
149149
'Ignored if --write-all is specified'))
150150

151151
group = parser.add_argument_group(__('general options'))
152-
group.add_argument('-b', '--builder', metavar='BUILDER', dest='builder',
152+
group.add_argument('--builder', '-b', metavar='BUILDER', dest='builder',
153153
default='html',
154154
help=__("builder to use (default: 'html')"))
155-
group.add_argument('-j', '--jobs', metavar='N', default=1, type=jobs_argument,
155+
group.add_argument('--jobs', '-j', metavar='N', default=1, type=jobs_argument,
156156
dest='jobs',
157157
help=__('run in parallel with N processes, when possible. '
158158
"'auto' uses the number of CPU cores"))
159-
group.add_argument('-a', '--write-all', action='store_true', dest='force_all',
159+
group.add_argument('--write-all', '-a', action='store_true', dest='force_all',
160160
help=__('write all files (default: only write new and '
161161
'changed files)'))
162-
group.add_argument('-E', '--fresh-env', action='store_true', dest='freshenv',
162+
group.add_argument('--fresh-env', '-E', action='store_true', dest='freshenv',
163163
help=__("don't use a saved environment, always read "
164164
'all files'))
165165

166166
group = parser.add_argument_group(__('path options'))
167-
group.add_argument('-d', '--doctree-dir', metavar='PATH', dest='doctreedir',
167+
group.add_argument('--doctree-dir', '-d', metavar='PATH', dest='doctreedir',
168168
help=__('directory for doctree and environment files '
169169
'(default: OUTPUT_DIR/.doctrees)'))
170-
group.add_argument('-c', '--conf-dir', metavar='PATH', dest='confdir',
170+
group.add_argument('--conf-dir', '-c', metavar='PATH', dest='confdir',
171171
help=__('directory for the configuration file (conf.py) '
172172
'(default: SOURCE_DIR)'))
173173

174174
group = parser.add_argument_group('build configuration options')
175-
group.add_argument('-C', '--isolated', action='store_true', dest='noconfig',
175+
group.add_argument('--isolated', '-C', action='store_true', dest='noconfig',
176176
help=__('use no configuration file, only use settings from -D options'))
177-
group.add_argument('-D', '--define', metavar='setting=value', action='append',
177+
group.add_argument('--define', '-D', metavar='setting=value', action='append',
178178
dest='define', default=[],
179179
help=__('override a setting in configuration file'))
180-
group.add_argument('-A', '--html-define', metavar='name=value', action='append',
180+
group.add_argument('--html-define', '-A', metavar='name=value', action='append',
181181
dest='htmldefine', default=[],
182182
help=__('pass a value into HTML templates'))
183-
group.add_argument('-t', '--tag', metavar='TAG', action='append',
183+
group.add_argument('--tag', '-t', metavar='TAG', action='append',
184184
dest='tags', default=[],
185185
help=__('define tag: include "only" blocks with TAG'))
186-
group.add_argument('-n', '--nitpicky', action='store_true', dest='nitpicky',
186+
group.add_argument('--nitpicky', '-n', action='store_true', dest='nitpicky',
187187
help=__('nit-picky mode: warn about all missing references'))
188188

189189
group = parser.add_argument_group(__('console output options'))
190-
group.add_argument('-v', '--verbose', action='count', dest='verbosity', default=0,
190+
group.add_argument('--verbose', '-v', action='count', dest='verbosity',
191+
default=0,
191192
help=__('increase verbosity (can be repeated)'))
192-
group.add_argument('-q', '--quiet', action='store_true', dest='quiet',
193+
group.add_argument('--quiet', '-q', action='store_true', dest='quiet',
193194
help=__('no output on stdout, just warnings on stderr'))
194-
group.add_argument('-Q', '--silent', action='store_true', dest='really_quiet',
195+
group.add_argument('--silent', '-Q', action='store_true', dest='really_quiet',
195196
help=__('no output at all, not even warnings'))
196-
group.add_argument('--color', action='store_const', const='yes',
197-
default='auto',
197+
group.add_argument('--color', action='store_const', dest='color',
198+
const='yes', default='auto',
198199
help=__('do emit colored output (default: auto-detect)'))
199-
group.add_argument('-N', '--no-color', dest='color', action='store_const',
200+
group.add_argument('--no-color', '-N', action='store_const', dest='color',
200201
const='no',
201202
help=__('do not emit colored output (default: auto-detect)'))
202203

203204
group = parser.add_argument_group(__('warning control options'))
204-
group.add_argument('-w', '--warning-file', metavar='FILE', dest='warnfile',
205+
group.add_argument('--warning-file', '-w', metavar='FILE', dest='warnfile',
205206
help=__('write warnings (and errors) to given file'))
206-
group.add_argument('-W', '--fail-on-warning', action='store_true', dest='warningiserror',
207+
group.add_argument('--fail-on-warning', '-W', action='store_true', dest='warningiserror',
207208
help=__('turn warnings into errors'))
208209
group.add_argument('--keep-going', action='store_true', dest='keep_going',
209210
help=__("with --fail-on-warning, keep going when getting warnings"))
210-
group.add_argument('-T', '--show-traceback', action='store_true', dest='traceback',
211+
group.add_argument('--show-traceback', '-T', action='store_true', dest='traceback',
211212
help=__('show full traceback on exception'))
212-
group.add_argument('-P', '--pdb', action='store_true', dest='pdb',
213+
group.add_argument('--pdb', '-P', action='store_true', dest='pdb',
213214
help=__('run Pdb on exception'))
214215

215216
return parser

0 commit comments

Comments
 (0)