comparison mercurial/helptext/flags.txt @ 43632:2e017696181f

help: create packages for the help text These files need to be loaded as resources with PyOxidizer, instead of using filesystem representations. AFAICT, the resource loading mechanisms only work for the named package given to it, and can't reach into a subdirectory. While here, the `help` directory is renamed to `helptext`. Without this, trying to load external help text crashed in mercurial/help.py when importing `.i18n`, saying there's no `mercurial.help.i18n` module. Differential Revision: https://phab.mercurial-scm.org/D7376
author Matt Harbison <matt_harbison@yahoo.com>
date Wed, 13 Nov 2019 21:52:25 -0500
parents mercurial/help/flags.txt@b0262b25ab48
children 33ef8841da62
comparison
equal deleted inserted replaced
43631:d3c4368099ed 43632:2e017696181f
1 Most Mercurial commands accept various flags.
2
3 Flag names
4 ==========
5
6 Flags for each command are listed in :hg:`help` for that command.
7 Additionally, some flags, such as --repository, are global and can be used with
8 any command - those are seen in :hg:`help -v`, and can be specified before or
9 after the command.
10
11 Every flag has at least a long name, such as --repository. Some flags may also
12 have a short one-letter name, such as the equivalent -R. Using the short or long
13 name is equivalent and has the same effect.
14
15 Flags that have a short name can also be bundled together - for instance, to
16 specify both --edit (short -e) and --interactive (short -i), one could use::
17
18 hg commit -ei
19
20 If any of the bundled flags takes a value (i.e. is not a boolean), it must be
21 last, followed by the value::
22
23 hg commit -im 'Message'
24
25 Flag types
26 ==========
27
28 Mercurial command-line flags can be strings, numbers, booleans, or lists of
29 strings.
30
31 Specifying flag values
32 ======================
33
34 The following syntaxes are allowed, assuming a flag 'flagname' with short name
35 'f'::
36
37 --flagname=foo
38 --flagname foo
39 -f foo
40 -ffoo
41
42 This syntax applies to all non-boolean flags (strings, numbers or lists).
43
44 Specifying boolean flags
45 ========================
46
47 Boolean flags do not take a value parameter. To specify a boolean, use the flag
48 name to set it to true, or the same name prefixed with 'no-' to set it to
49 false::
50
51 hg commit --interactive
52 hg commit --no-interactive
53
54 Specifying list flags
55 =====================
56
57 List flags take multiple values. To specify them, pass the flag multiple times::
58
59 hg files --include mercurial --include tests
60
61 Setting flag defaults
62 =====================
63
64 In order to set a default value for a flag in an hgrc file, it is recommended to
65 use aliases::
66
67 [alias]
68 commit = commit --interactive
69
70 For more information on hgrc files, see :hg:`help config`.
71
72 Overriding flags on the command line
73 ====================================
74
75 If the same non-list flag is specified multiple times on the command line, the
76 latest specification is used::
77
78 hg commit -m "Ignored value" -m "Used value"
79
80 This includes the use of aliases - e.g., if one has::
81
82 [alias]
83 committemp = commit -m "Ignored value"
84
85 then the following command will override that -m::
86
87 hg committemp -m "Used value"
88
89 Overriding flag defaults
90 ========================
91
92 Every flag has a default value, and you may also set your own defaults in hgrc
93 as described above.
94 Except for list flags, defaults can be overridden on the command line simply by
95 specifying the flag in that location.
96
97 Hidden flags
98 ============
99
100 Some flags are not shown in a command's help by default - specifically, those
101 that are deemed to be experimental, deprecated or advanced. To show all flags,
102 add the --verbose flag for the help command::
103
104 hg help --verbose commit