Debian Codegraph @

src/options/args.rs

raw symbols SCIP
1 //! Argument parsing via clap.
2 //!
3 //! Note that you probably want to keep this as a single file so the build
4 //! script doesn't trip all over itself.
5
6 // TODO: New sections are misaligned! See if we can get that fixed.
7
8 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#;
9
10 use claprust-analyzer cargo clap 4.6.6 crate/::{builderrust-analyzer cargo clap_builder 4.6.6 builder/::PossibleValuerust-analyzer cargo clap_builder 4.6.6 builder/possible_value/PossibleValue#, *};
11 use indocrust-analyzer cargo indoc 2.0.7 crate/::indocrust-analyzer cargo indoc 2.0.7 indoc!;
12
13 const TEMPLATErust-analyzer cargo bottom 0.14.9 options/args/TEMPLATE.: &str = indocrust-analyzer cargo indoc 2.0.7 indoc!! {
14 "{name} {version}
15 {author}
16
17 {about}
18
19 {usage-heading} {usage}
20
21 {all-args}"
22 };
23
24 const USAGErust-analyzer cargo bottom 0.14.9 options/args/USAGE.: &str = "btm [OPTIONS]";
25
26 // Can't use an unwrap here at the moment since it's const.
27 const VERSIONrust-analyzer cargo bottom 0.14.9 options/args/VERSION.: &str = match option_envrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/option_env!!("NIGHTLY_VERSION") {
28 Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(nightly_version) => nightly_version,
29 Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None# => crate_versionrust-analyzer cargo clap_builder 4.6.6 macros/crate_version!!(),
30 };
31
32 const CHART_WIDGET_POSITIONSrust-analyzer cargo bottom 0.14.9 options/args/CHART_WIDGET_POSITIONS.: [&str; 9] = [
33 "none",
34 "top-left",
35 "top",
36 "top-right",
37 "left",
38 "right",
39 "bottom-left",
40 "bottom",
41 "bottom-right",
42 ];
43
44 /// Represents the arguments that can be passed in to bottom.
45 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Parserrust-analyzer cargo clap_derive 4.6.4 Parser:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)]
46 #[command(
47 name = crate_namerust-analyzer cargo clap_builder 4.6.6 macros/crate_name!!(),
48 versionrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]version(). = VERSIONrust-analyzer cargo bottom 0.14.9 options/args/VERSION.,
49 authorrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]author(). = crate_authorsrust-analyzer cargo clap_builder 4.6.6 macros/crate_authors!!(),
50 aboutrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]about(). = crate_descriptionrust-analyzer cargo clap_builder 4.6.6 macros/crate_description!!(),
51 disable_help_flagrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]disable_help_flag(). = true,
52 disable_version_flagrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]disable_version_flag(). = true,
53 colorrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]color(). = ColorChoicerust-analyzer cargo clap_builder 4.6.6 util/color/ColorChoice#::Autorust-analyzer cargo clap_builder 4.6.6 util/color/ColorChoice#Auto#,
54 help_templaterust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]help_template(). = TEMPLATErust-analyzer cargo bottom 0.14.9 options/args/TEMPLATE.,
55 override_usagerust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]override_usage(). = USAGErust-analyzer cargo bottom 0.14.9 options/args/USAGE.,
56 )]
57 pub struct BottomArgsrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs# {
58 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
59 pub generalrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#general.: GeneralArgsrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#,
60
61 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
62 pub processrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#process.: ProcessArgsrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#,
63
64 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
65 pub temperaturerust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#temperature.: TemperatureArgsrust-analyzer cargo bottom 0.14.9 options/args/TemperatureArgs#,
66
67 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
68 pub cpurust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#cpu.: CpuArgsrust-analyzer cargo bottom 0.14.9 options/args/CpuArgs#,
69
70 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
71 pub memoryrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#memory.: MemoryArgsrust-analyzer cargo bottom 0.14.9 options/args/MemoryArgs#,
72
73 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
74 pub networkrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#network.: NetworkArgsrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#,
75
76 #[cfg(feature = "battery")]
77 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
78 pub batteryrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#battery.: BatteryArgsrust-analyzer cargo bottom 0.14.9 options/args/BatteryArgs#,
79
80 #[cfg(feature = "gpu")]
81 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
82 pub gpurust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#gpu.: GpuArgsrust-analyzer cargo bottom 0.14.9 options/args/GpuArgs#,
83
84 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
85 pub stylerust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#style.: StyleArgsrust-analyzer cargo bottom 0.14.9 options/args/StyleArgs#,
86
87 #[commandrust-analyzer cargo clap_derive 4.6.4 command:(flatten)]
88 pub otherrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#other.: OtherArgsrust-analyzer cargo bottom 0.14.9 options/args/OtherArgs#,
89 }
90
91 /// General arguments/config options.
92 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)]
93 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "General Options", rename_all = "snake_case")]
94 pub struct GeneralArgsrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs# {
95 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
96 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
97 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
98 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Temporarily shows the time scale in graphs.",
99 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Automatically hides the time scale in graphs after being shown for a brief moment when zoomed \
100 in/out. If time is disabled using --hide_time then this will have no effect.",
101 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "autohide-time"
102 )]
103 pub autohide_timerust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#autohide_time.: bool,
104
105 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
106 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'b',
107 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
108 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
109 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Hides graphs and uses a more basic look.",
110 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Hides graphs and uses a more basic look, largely inspired by htop's design."
111 )]
112 pub basicrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#basic.: bool,
113
114 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
115 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'C',
116 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
117 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "PATH",
118 value_hintrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_hint(). = ValueHintrust-analyzer cargo clap_builder 4.6.6 builder/value_hint/ValueHint#::AnyPathrust-analyzer cargo clap_builder 4.6.6 builder/value_hint/ValueHint#AnyPath#,
119 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Sets the location of the config file.",
120 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Sets the location of the config file. Expects a config file in the TOML format. \
121 If it doesn't exist, a default config file is created at the path. If no path is provided, \
122 the default config location will be used.",
123 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "config-location",
124 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "config",
125 )]
126 pub config_locationrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#config_location.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<PathBufrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/PathBuf#>,
127
128 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
129 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 't',
130 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
131 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "TIME",
132 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Default time value for graphs.",
133 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Default time value for graphs. Either a number in milliseconds or a 'human duration' \
134 (e.g. 60s, 10m). Defaults to 60s, must be at least 30s.",
135 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "default-time-value"
136 )]
137 pub default_time_valuerust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#default_time_value.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
138
139 // TODO: Charts are broken in the manpage
140 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
141 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
142 requires_allrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]requires_all(). = ["default_widget_type"],
143 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "N",
144 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Sets the N'th selected widget type as the default.",
145 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = indocrust-analyzer cargo indoc 2.0.7 indoc!! {
146 "Sets the N'th selected widget type to use as the default widget. Requires 'default_widget_type' to also be \
147 set, and defaults to 1.
148
149 This reads from left to right, top to bottom. For example, suppose we have a layout that looks like:
150 +-------------------+-----------------------+
151 | CPU (1) | CPU (2) |
152 +---------+---------+-------------+---------+
153 | Process | CPU (3) | Temperature | CPU (4) |
154 +---------+---------+-------------+---------+
155
156 And we set our default widget type to 'CPU'. If we set '--default_widget_count 1', then it would use the \
157 CPU (1) as the default widget. If we set '--default_widget_count 3', it would use CPU (3) as the default \
158 instead."
159 },
160 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "default-widget-count"
161 )]
162 pub default_widget_countrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#default_widget_count.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<u64>,
163
164 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
165 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
166 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "WIDGET",
167 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Sets the default widget type. Use --help for more info.",
168 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = indocrust-analyzer cargo indoc 2.0.7 indoc!!{
169 "Sets which widget type to use as the default widget. For the default \
170 layout, this defaults to the 'process' widget. For a custom layout, it defaults \
171 to the first widget it sees.
172
173 For example, suppose we have a layout that looks like:
174 +-------------------+-----------------------+
175 | CPU (1) | CPU (2) |
176 +---------+---------+-------------+---------+
177 | Process | CPU (3) | Temperature | CPU (4) |
178 +---------+---------+-------------+---------+
179
180 Then, setting '--default_widget_type temperature' will make the temperature widget selected by default."
181 },
182 value_parserrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_parser(). = [
183 "cpu",
184 "mem",
185 "net",
186 "network",
187 "proc",
188 "process",
189 "processes",
190 "temp",
191 "temperature",
192 "disk",
193 #[cfg(feature = "battery")]
194 "batt",
195 #[cfg(feature = "battery")]
196 "battery",
197 ],
198 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "default-widget-type"
199 )]
200 pub default_widget_typerust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#default_widget_type.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
201
202 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
203 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
204 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
205 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Disables mouse clicks.",
206 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Disables mouse clicks from interacting with bottom.",
207 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "disable-click"
208 )]
209 pub disable_clickrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#disable_click.: bool,
210
211 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
212 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
213 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
214 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Disables keyboard shortcuts, INCLUDING the ones that stop bottom.",
215 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Disables keyboard shortcuts from interacting with bottom. Note this includes keyboard shortcuts to quit bottom.",
216 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "disable-keys"
217 )]
218 pub disable_keysrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#disable_keys.: bool,
219
220 // TODO: Change this to accept a string with the type of marker.
221 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
222 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'm',
223 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
224 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
225 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Uses a dot marker for graphs.",
226 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Uses a dot marker for graphs as opposed to the default braille marker.",
227 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "dot-marker"
228 )]
229 pub dot_markerrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#dot_marker.: bool,
230
231 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
232 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'e',
233 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
234 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
235 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Expand the default widget upon starting the app.",
236 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Expand the default widget upon starting the app. This flag has no effect in basic mode (--basic)."
237 )]
238 pub expandedrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#expanded.: bool,
239
240 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long()., actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#, helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Hides the time scale from being shown.", aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "hide-time")]
241 pub hide_timerust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#hide_time.: bool,
242
243 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
244 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'r',
245 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
246 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "TIME",
247 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Sets how often data is refreshed.",
248 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Sets how often data is refreshed. Either a number in milliseconds or a 'human duration' \
249 (e.g. 1s, 1m). Defaults to 1s, must be at least 250ms. Smaller values may result in \
250 higher system resource usage."
251 )]
252 pub raterust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#rate.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
253
254 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
255 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
256 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "TIME",
257 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "How far back data will be stored up to.",
258 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "How far back data will be stored up to. Either a number in milliseconds or a 'human duration' \
259 (e.g. 10m, 1h). Defaults to 10 minutes, and must be at least 1 minute. Larger values \
260 may result in higher memory usage."
261 )]
262 pub retentionrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#retention.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
263
264 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
265 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
266 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
267 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Shows the list scroll position tracker in the widget title for table widgets.",
268 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "show-table-scroll-position"
269 )]
270 pub show_table_scroll_positionrust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#show_table_scroll_position.: bool,
271
272 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
273 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'd',
274 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
275 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "TIME",
276 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "The amount of time changed upon zooming.",
277 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "The amount of time changed when zooming in/out. Takes a number in \
278 milliseconds or a human duration (e.g. 30s). The minimum is 1s, and \
279 defaults to 15s.",
280 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "time-delta"
281 )]
282 pub time_deltarust-analyzer cargo bottom 0.14.9 options/args/GeneralArgs#time_delta.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
283 }
284
285 /// Process arguments/config options.
286 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
287 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "Process Options", rename_all = "snake_case")]
288 pub struct ProcessArgsrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs# {
289 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
290 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'S',
291 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
292 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
293 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Enables case sensitivity by default when searching.",
294 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Enables case sensitivity by default when searching for a process.",
295 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "case-sensitive"
296 )]
297 pub case_sensitiverust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#case_sensitive.: bool,
298
299 // TODO: Rename this.
300 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
301 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'u',
302 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
303 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
304 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Calculates process CPU usage as a percentage of current usage rather than total usage.",
305 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "current-usage"
306 )]
307 pub current_usagerust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#current_usage.: bool,
308
309 #[cfg(any(target_os = "linux", target_os = "macos", target_os = "freebsd"))]
310 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
311 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
312 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
313 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Hides additional stopping options on Unix-like systems.",
314 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Hides additional stopping options on Unix-like systems. Signal 15 (TERM) will be sent when \
315 stopping a process.",
316 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "disable-advanced-kill"
317 )]
318 pub disable_advanced_killrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#disable_advanced_kill.: bool,
319
320 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
321 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
322 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
323 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Prevents performing any actions that affect the system.",
324 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Prevents performing any actions that affect the system. Disables operations such as stopping or sending signals \
325 to processes.",
326 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "read-only"
327 )]
328 pub read_onlyrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#read_only.: bool,
329
330 #[cfg(target_os = "linux")]
331 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
332 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
333 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
334 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Hide kernel threads.",
335 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "hide-k-threads"
336 )]
337 pub hide_k_threadsrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#hide_k_threads.: bool,
338
339 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
340 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
341 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
342 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Also gather process thread information.",
343 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "get-threads",
344 )]
345 pub get_threadsrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#get_threads.: bool,
346
347 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
348 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
349 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "COLUMN",
350 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Sets the default sort column for the process widget.",
351 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Sets the default sort column for the process widget. Accepts any of the \
352 valid process column names (e.g. \"cpu%\", \"mem\", \"pid\", \"name\"). \
353 Overrides the [processes] default_sort setting in the config file.",
354 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "process-default-sort"
355 )]
356 pub process_default_sortrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#process_default_sort.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
357
358 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
359 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'g',
360 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
361 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
362 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Groups processes with the same name by default when searching.",
363 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Groups processes with the same name by default when searching. Doesn't do anything if --tree is also set, or \
364 tree=true in the config.",
365 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "group-processes"
366 )]
367 pub group_processesrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#group_processes.: bool,
368
369 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
370 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
371 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
372 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Defaults to showing process memory usage by value.",
373 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Defaults to showing process memory usage by value. Otherwise, it defaults to showing it by percentage.",
374 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "process-memory-as-value"
375 )]
376 pub process_memory_as_valuerust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#process_memory_as_value.: bool,
377
378 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
379 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
380 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
381 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Shows the full command name instead of the process name by default.",
382 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "process-command"
383 )]
384 pub process_commandrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#process_command.: bool,
385
386 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'R', longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long()., actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#, helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Enables regex by default while searching.")]
387 pub regexrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#regex.: bool,
388
389 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
390 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'T',
391 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
392 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
393 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Makes the process widget use tree mode by default."
394 )]
395 pub treerust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#tree.: bool,
396
397 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
398 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
399 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
400 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Collapse process tree by default.",
401 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "tree-collapse"
402 )]
403 pub tree_collapserust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#tree_collapse.: bool,
404
405 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
406 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'n',
407 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
408 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
409 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Show process CPU% usage without averaging over the number of CPU cores.",
410 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "unnormalized-cpu"
411 )]
412 pub unnormalized_cpurust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#unnormalized_cpu.: bool,
413
414 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
415 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'W',
416 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
417 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
418 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Enables whole-word matching by default while searching.",
419 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "whole-word"
420 )]
421 pub whole_wordrust-analyzer cargo bottom 0.14.9 options/args/ProcessArgs#whole_word.: bool,
422 }
423
424 /// Temperature arguments/config options.
425 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
426 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "Temperature Options", rename_all = "snake_case")]
427 #[group(id = "temperature_unit", multiplerust-analyzer cargo clap_builder 4.6.6 builder/arg_group/impl#[ArgGroup]multiple(). = false)]
428 pub struct TemperatureArgsrust-analyzer cargo bottom 0.14.9 options/args/TemperatureArgs# {
429 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
430 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'c',
431 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
432 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
433 grouprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]group(). = "temperature_unit",
434 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Use Celsius as the temperature unit. Default.",
435 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Use Celsius as the temperature unit. This is the default option."
436 )]
437 pub celsiusrust-analyzer cargo bottom 0.14.9 options/args/TemperatureArgs#celsius.: bool,
438
439 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
440 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'f',
441 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
442 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
443 grouprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]group(). = "temperature_unit",
444 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Use Fahrenheit as the temperature unit."
445 )]
446 pub fahrenheitrust-analyzer cargo bottom 0.14.9 options/args/TemperatureArgs#fahrenheit.: bool,
447
448 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
449 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'k',
450 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
451 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
452 grouprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]group(). = "temperature_unit",
453 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Use Kelvin as the temperature unit."
454 )]
455 pub kelvinrust-analyzer cargo bottom 0.14.9 options/args/TemperatureArgs#kelvin.: bool,
456 }
457
458 /// The default selection of the CPU widget. If the given selection is invalid,
459 /// we will fall back to all.
460 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
461 pub enum CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault# {
462 #[defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/default:]
463 Allrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#All#,
464 Averagerust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#Average#,
465 }
466
467 impl ValueEnumrust-analyzer cargo clap_builder 4.6.6 derive/ValueEnum# for CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault# {
468 fn value_variantsrust-analyzer cargo bottom 0.14.9 options/args/impl#[CpuDefault][ValueEnum]value_variants().<'a>() -> &'a [Selfrust-analyzer cargo bottom 0.14.9 options/args/impl#[CpuDefault][ValueEnum]] {
469 &[CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#::Allrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#All#, CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#::Averagerust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#Average#]
470 }
471
472 fn to_possible_valuerust-analyzer cargo bottom 0.14.9 options/args/impl#[CpuDefault][ValueEnum]to_possible_value().(&self) -> Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<PossibleValuerust-analyzer cargo clap_builder 4.6.6 builder/possible_value/PossibleValue#> {
473 match self {
474 CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#::Allrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#All# => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(PossibleValuerust-analyzer cargo clap_builder 4.6.6 builder/possible_value/PossibleValue#::newrust-analyzer cargo clap_builder 4.6.6 builder/possible_value/impl#[PossibleValue]new().("all")),
475 CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#::Averagerust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#Average# => Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(PossibleValuerust-analyzer cargo clap_builder 4.6.6 builder/possible_value/PossibleValue#::newrust-analyzer cargo clap_builder 4.6.6 builder/possible_value/impl#[PossibleValue]new().("avg").aliasrust-analyzer cargo clap_builder 4.6.6 builder/possible_value/impl#[PossibleValue]alias().("average")),
476 }
477 }
478 }
479
480 /// CPU arguments/config options.
481 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
482 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "CPU Options", rename_all = "snake_case")]
483 pub struct CpuArgsrust-analyzer cargo bottom 0.14.9 options/args/CpuArgs# {
484 // TODO: Maybe rename this or fix this? Should this apply to all "left legends"?
485 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
486 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'l',
487 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
488 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
489 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Puts the CPU chart legend on the left side.",
490 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "cpu-left-legend"
491 )]
492 pub cpu_left_legendrust-analyzer cargo bottom 0.14.9 options/args/CpuArgs#cpu_left_legend.: bool,
493
494 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
495 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
496 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Sets which CPU entry type is selected by default.",
497 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "ENTRY",
498 value_parserrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_parser(). = value_parserrust-analyzer cargo clap_builder 4.6.6 builder/value_parser/value_parser!!(CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#),
499 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "default-cpu-entry"
500 )]
501 pub default_cpu_entryrust-analyzer cargo bottom 0.14.9 options/args/CpuArgs#default_cpu_entry.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<CpuDefaultrust-analyzer cargo bottom 0.14.9 options/args/CpuDefault#>,
502
503 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
504 shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'a',
505 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
506 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
507 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Hides the average CPU usage entry.",
508 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "hide-avg-cpu"
509 )]
510 pub hide_avg_cpurust-analyzer cargo bottom 0.14.9 options/args/CpuArgs#hide_avg_cpu.: bool,
511 }
512
513 /// Memory argument/config options.
514 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
515 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "Memory Options", rename_all = "snake_case")]
516 pub struct MemoryArgsrust-analyzer cargo bottom 0.14.9 options/args/MemoryArgs# {
517 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
518 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
519 value_parserrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_parser(). = CHART_WIDGET_POSITIONSrust-analyzer cargo bottom 0.14.9 options/args/CHART_WIDGET_POSITIONS.,
520 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "POSITION",
521 ignore_caserust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]ignore_case(). = true,
522 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Where to place the legend for the memory chart widget.",
523 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "memory-legend"
524 )]
525 pub memory_legendrust-analyzer cargo bottom 0.14.9 options/args/MemoryArgs#memory_legend.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
526
527 #[cfg(not(target_os = "windows"))]
528 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
529 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
530 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
531 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Enables collecting and displaying cache and buffer memory.",
532 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "enable-cache-memory"
533 )]
534 pub enable_cache_memoryrust-analyzer cargo bottom 0.14.9 options/args/MemoryArgs#enable_cache_memory.: bool,
535
536 #[cfg(feature = "zfs")]
537 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
538 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
539 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
540 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Subtract reclaimable ARC from memory.",
541 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "free-arc"
542 )]
543 pub free_arcrust-analyzer cargo bottom 0.14.9 options/args/MemoryArgs#free_arc.: bool,
544
545 #[cfg(feature = "gpu")]
546 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
547 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
548 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
549 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Use short GPU names (e.g. 'GPU' or 'GPU0', 'GPU1') in the memory widget instead of full GPU names.",
550 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "short-gpu-names"
551 )]
552 pub short_gpu_namesrust-analyzer cargo bottom 0.14.9 options/args/MemoryArgs#short_gpu_names.: bool,
553 }
554
555 /// Network arguments/config options.
556 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
557 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "Network Options", rename_all = "snake_case")]
558 pub struct NetworkArgsrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs# {
559 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
560 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
561 value_parserrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_parser(). = CHART_WIDGET_POSITIONSrust-analyzer cargo bottom 0.14.9 options/args/CHART_WIDGET_POSITIONS.,
562 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "POSITION",
563 ignore_caserust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]ignore_case(). = true,
564 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Where to place the legend for the network chart widget.",
565 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "network-legend"
566 )]
567 pub network_legendrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#network_legend.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
568
569 // TODO: Rename some of these to remove the network prefix for serde.
570 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
571 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
572 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
573 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Displays the network widget using bytes.",
574 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Displays the network widget using bytes. Defaults to bits.",
575 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "network-use-bytes"
576 )]
577 pub network_use_bytesrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#network_use_bytes.: bool,
578
579 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
580 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
581 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
582 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Displays the network widget with binary prefixes.",
583 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Displays the network widget with binary prefixes (e.g. kibibits, mebibits) rather than a decimal \
584 prefixes (e.g. kilobits, megabits). Defaults to decimal prefixes.",
585 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "network-use-binary-prefix"
586 )]
587 pub network_use_binary_prefixrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#network_use_binary_prefix.: bool,
588
589 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
590 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
591 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
592 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Displays the network widget with a log scale.",
593 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Displays the network widget with a log scale. Defaults to a non-log scale.",
594 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "network-use-log"
595 )]
596 pub network_use_logrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#network_use_log.: bool,
597
598 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
599 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
600 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
601 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "(DEPRECATED) Uses a separate network legend.",
602 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "(DEPRECATED) Uses separate network widget legend. This display is not tested and may be broken.",
603 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "use-old-network-legend"
604 )]
605 pub use_old_network_legendrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#use_old_network_legend.: bool,
606
607 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
608 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
609 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
610 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Displays packets information (packet rate and average packet size) in the network widget.",
611 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Displays packets information including packet rate (packets per second) and average packet size in the network widget.",
612 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "show-packets"
613 )]
614 pub show_packetsrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#show_packets.: bool,
615
616 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
617 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
618 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
619 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Show total network usage from app startup rather than on boot.",
620 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Zeroes out the total network usage (\"All\") counters so it shows the total usage since the app is started, rather than the total usage since boot.",
621 aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "network-start-zeroed"
622 )]
623 pub network_start_zeroedrust-analyzer cargo bottom 0.14.9 options/args/NetworkArgs#network_start_zeroed.: bool,
624 }
625
626 /// Battery arguments/config options.
627 #[cfg(feature = "battery")]
628 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
629 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "Battery Options", rename_all = "snake_case")]
630 pub struct BatteryArgsrust-analyzer cargo bottom 0.14.9 options/args/BatteryArgs# {
631 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
632 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
633 actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#,
634 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Shows the battery widget in non-custom layouts.",
635 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = "Shows the battery widget in default or basic mode, if there is as battery available. This \
636 has no effect on custom layouts; if the battery widget is desired for a custom layout, explicitly \
637 specify it."
638 )]
639 pub batteryrust-analyzer cargo bottom 0.14.9 options/args/BatteryArgs#battery.: bool,
640 }
641
642 /// GPU arguments/config options.
643 #[cfg(feature = "gpu")]
644 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
645 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "GPU Options", rename_all = "snake_case")]
646 pub struct GpuArgsrust-analyzer cargo bottom 0.14.9 options/args/GpuArgs# {
647 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long()., actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::SetTruerust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#SetTrue#, helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Disable collecting and displaying NVIDIA and AMD GPU information.", aliasrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]alias(). = "disable-gpu")]
648 pub disable_gpurust-analyzer cargo bottom 0.14.9 options/args/GpuArgs#disable_gpu.: bool,
649 }
650
651 /// Style arguments/config options.
652 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
653 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "Style Options", rename_all = "snake_case")]
654 pub struct StyleArgsrust-analyzer cargo bottom 0.14.9 options/args/StyleArgs# {
655 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(
656 longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long().,
657 value_namerust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_name(). = "SCHEME",
658 value_parserrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]value_parser(). = [
659 "default",
660 "default-light",
661 "gruvbox",
662 "gruvbox-light",
663 "nord",
664 "nord-light",
665 ],
666 hide_possible_valuesrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]hide_possible_values(). = true,
667 helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = indocrust-analyzer cargo indoc 2.0.7 indoc!! {
668 "Use a built-in colour theme, use '--help' for info on the colours. [possible values: default, default-light, gruvbox, gruvbox-light, nord, nord-light]",
669 },
670 long_helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long_help(). = indocrust-analyzer cargo indoc 2.0.7 indoc!! {
671 "Use a pre-defined colour theme. Currently supported themes are:
672 - default
673 - default-light (default but adjusted for lighter backgrounds)
674 - gruvbox (a bright theme with 'retro groove' colours)
675 - gruvbox-light (gruvbox but adjusted for lighter backgrounds)
676 - nord (an arctic, north-bluish colour palette)
677 - nord-light (nord but adjusted for lighter backgrounds)"
678 }
679 )]
680 pub themerust-analyzer cargo bottom 0.14.9 options/args/StyleArgs#theme.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
681 }
682
683 /// Other arguments. This just handle options that are for help/version
684 /// displaying.
685 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Argsrust-analyzer cargo clap_derive 4.6.4 Args:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)]
686 #[command(next_help_headingrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]next_help_heading(). = "Other Options", rename_all = "snake_case")]
687 pub struct OtherArgsrust-analyzer cargo bottom 0.14.9 options/args/OtherArgs# {
688 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'h', longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long()., actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::Helprust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#Help#, helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Prints help info (for more details use '--help').")]
689 helprust-analyzer cargo bottom 0.14.9 options/args/OtherArgs#help.: (),
690
691 #[argrust-analyzer cargo clap_derive 4.6.4 arg:(shortrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]short(). = 'V', longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]long()., actionrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]action(). = ArgActionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#::Versionrust-analyzer cargo clap_builder 4.6.6 builder/action/ArgAction#Version#, helprust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]help(). = "Prints version information.")]
692 versionrust-analyzer cargo bottom 0.14.9 options/args/OtherArgs#version.: (),
693 }
694
695 /// Parse arguments and return a [`BottomArgs`]. If this fails it will exit the
696 /// program.
697 pub fn get_argsrust-analyzer cargo bottom 0.14.9 options/args/get_args().() -> BottomArgsrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs# {
698 BottomArgsrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#::parserust-analyzer cargo clap_builder 4.6.6 derive/Parser#parse().()
699 }
700
701 /// Returns an [`Command`] based off of [`BottomArgs`].
702 #[cfg(test)]
703 pub(craterust-analyzer cargo bottom 0.14.9 crate/) fn build_cmdrust-analyzer cargo bottom 0.14.9 options/args/build_cmd().() -> Commandrust-analyzer cargo clap_builder 4.6.6 builder/command/Command# {
704 BottomArgsrust-analyzer cargo bottom 0.14.9 options/args/BottomArgs#::commandrust-analyzer cargo bottom 0.14.9 options/args/impl#[BottomArgs][CommandFactory]command().()
705 }
706
707 #[cfg(test)]
708 mod testrust-analyzer cargo bottom 0.14.9 options/args/test/ {
709 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#;
710
711 use superrust-analyzer cargo bottom 0.14.9 options/args/::*;
712
713 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
714 fn verify_clirust-analyzer cargo bottom 0.14.9 options/args/test/verify_cli().() {
715 build_cmdrust-analyzer cargo bottom 0.14.9 options/args/build_cmd().().debug_assertrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]debug_assert().();
716 }
717
718 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
719 fn no_default_help_headingrust-analyzer cargo bottom 0.14.9 options/args/test/no_default_help_heading().() {
720 let mut cmd = build_cmdrust-analyzer cargo bottom 0.14.9 options/args/build_cmd().();
721
722 let help_str = cmd.render_helprust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]render_help().();
723 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(
724 !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().help_str.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("\nOptions:\n"),
725 "the default 'Options' heading should not exist; if it does then an argument is \
726 missing a help heading."
727 );
728
729 let long_help_str = cmd.render_long_helprust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]render_long_help().();
730 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(
731 !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().long_help_str.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("\nOptions:\n"),
732 "the default 'Options' heading should not exist; if it does then an argument is \
733 missing a help heading."
734 );
735 }
736
737 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
738 fn catch_incorrect_long_argsrust-analyzer cargo bottom 0.14.9 options/args/test/catch_incorrect_long_args().() {
739 // Set this to allow certain ones through if needed.
740 let allow_list: HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#<&str> = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![].into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
741 let cmd = build_cmdrust-analyzer cargo bottom 0.14.9 options/args/build_cmd().();
742
743 for opt in cmd.get_optsrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]get_opts().() {
744 let long_flag = opt.get_longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]get_long().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().();
745
746 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().allow_list.containsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/impl#[`HashSet<T, S, A>`]contains().(long_flag) {
747 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(
748 long_flag.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]len().() <rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]lt(). 30,
749 "the long help arg '{long_flag}' might be set wrong, please take a look!"
750 );
751 }
752 }
753 }
754
755 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
756 fn catch_missing_hyphen_aliasrust-analyzer cargo bottom 0.14.9 options/args/test/catch_missing_hyphen_alias().() {
757 let cmd = build_cmdrust-analyzer cargo bottom 0.14.9 options/args/build_cmd().();
758
759 for opt in cmd.get_optsrust-analyzer cargo clap_builder 4.6.6 builder/command/impl#[Command]get_opts().() {
760 let long_flag = opt.get_longrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]get_long().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().();
761 if long_flag.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("_") {
762 let aliased_version = long_flag.replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().("_", "-");
763 let stored_alias = opt.get_aliasesrust-analyzer cargo clap_builder 4.6.6 builder/arg/impl#[Arg]get_aliases().().unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| {
764 panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("'{long_flag}' should have an alias, if not, it's missing")
765 });
766
767 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(
768 stored_alias.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]contains().(&aliased_version.as_strrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_str().()),
769 "'{long_flag}' has an incorrectly defined alias"
770 );
771 }
772 }
773 }
774 }