]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
daf71ef6 LP |
2 | #pragma once |
3 | ||
4 | #include <stdbool.h> | |
5 | ||
255b1fc8 | 6 | #include "bus-print-properties.h" |
daf71ef6 | 7 | #include "bus-util.h" |
84be0c71 | 8 | #include "image-policy.h" |
daf71ef6 LP |
9 | #include "install.h" |
10 | #include "output-mode.h" | |
11 | #include "pager.h" | |
12 | ||
13 | enum action { | |
14 | ACTION_SYSTEMCTL, | |
15 | ACTION_HALT, | |
16 | ACTION_POWEROFF, | |
17 | ACTION_REBOOT, | |
18 | ACTION_KEXEC, | |
34f21ff6 | 19 | ACTION_SOFT_REBOOT, |
daf71ef6 LP |
20 | ACTION_EXIT, |
21 | ACTION_SUSPEND, | |
22 | ACTION_HIBERNATE, | |
23 | ACTION_HYBRID_SLEEP, | |
24 | ACTION_SUSPEND_THEN_HIBERNATE, | |
25 | ACTION_RUNLEVEL2, | |
26 | ACTION_RUNLEVEL3, | |
27 | ACTION_RUNLEVEL4, | |
28 | ACTION_RUNLEVEL5, | |
29 | ACTION_RESCUE, | |
30 | ACTION_EMERGENCY, | |
31 | ACTION_DEFAULT, | |
32 | ACTION_RELOAD, | |
33 | ACTION_REEXEC, | |
34 | ACTION_RUNLEVEL, | |
ea71b460 | 35 | ACTION_TELINIT, |
daf71ef6 | 36 | ACTION_CANCEL_SHUTDOWN, |
a9c3cc8d | 37 | ACTION_SHOW_SHUTDOWN, |
daf71ef6 | 38 | _ACTION_MAX, |
2d93c20e | 39 | _ACTION_INVALID = -EINVAL, |
daf71ef6 LP |
40 | }; |
41 | ||
42 | enum dependency { | |
43 | DEPENDENCY_FORWARD, | |
44 | DEPENDENCY_REVERSE, | |
45 | DEPENDENCY_AFTER, | |
46 | DEPENDENCY_BEFORE, | |
47 | _DEPENDENCY_MAX | |
48 | }; | |
49 | ||
50 | extern char **arg_types; | |
51 | extern char **arg_states; | |
52 | extern char **arg_properties; | |
53 | extern bool arg_all; | |
54 | extern enum dependency arg_dependency; | |
a88f9dba | 55 | extern const char *_arg_job_mode; |
4870133b | 56 | extern RuntimeScope arg_runtime_scope; |
daf71ef6 LP |
57 | extern bool arg_wait; |
58 | extern bool arg_no_block; | |
6906da26 | 59 | extern int arg_legend; |
daf71ef6 LP |
60 | extern PagerFlags arg_pager_flags; |
61 | extern bool arg_no_wtmp; | |
62 | extern bool arg_no_sync; | |
63 | extern bool arg_no_wall; | |
64 | extern bool arg_no_reload; | |
255b1fc8 | 65 | extern BusPrintPropertyFlags arg_print_flags; |
daf71ef6 | 66 | extern bool arg_show_types; |
4327574f | 67 | extern int arg_check_inhibitors; |
daf71ef6 LP |
68 | extern bool arg_dry_run; |
69 | extern bool arg_quiet; | |
108d35ac | 70 | extern bool arg_no_warn; |
daf71ef6 LP |
71 | extern bool arg_full; |
72 | extern bool arg_recursive; | |
73 | extern bool arg_with_dependencies; | |
74 | extern bool arg_show_transaction; | |
75 | extern int arg_force; | |
76 | extern bool arg_ask_password; | |
77 | extern bool arg_runtime; | |
78 | extern UnitFilePresetMode arg_preset_mode; | |
79 | extern char **arg_wall; | |
4ccde410 | 80 | extern const char *arg_kill_whom; |
daf71ef6 | 81 | extern int arg_signal; |
d06e6199 LP |
82 | extern int arg_kill_value; |
83 | extern bool arg_kill_value_set; | |
daf71ef6 LP |
84 | extern char *arg_root; |
85 | extern usec_t arg_when; | |
86 | extern const char *arg_reboot_argument; | |
87 | extern enum action arg_action; | |
88 | extern BusTransport arg_transport; | |
89 | extern const char *arg_host; | |
90 | extern unsigned arg_lines; | |
91 | extern OutputMode arg_output; | |
92 | extern bool arg_plain; | |
93 | extern bool arg_firmware_setup; | |
94 | extern usec_t arg_boot_loader_menu; | |
95 | extern const char *arg_boot_loader_entry; | |
96 | extern bool arg_now; | |
97 | extern bool arg_jobs_before; | |
98 | extern bool arg_jobs_after; | |
99 | extern char **arg_clean_what; | |
100 | extern TimestampStyle arg_timestamp_style; | |
5e8deb94 LB |
101 | extern bool arg_read_only; |
102 | extern bool arg_mkdir; | |
c9615f73 | 103 | extern bool arg_marked; |
f206809b | 104 | extern const char *arg_drop_in; |
84be0c71 | 105 | extern ImagePolicy *arg_image_policy; |
5fd87823 | 106 | |
a88f9dba ZJS |
107 | static inline const char* arg_job_mode(void) { |
108 | return _arg_job_mode ?: "replace"; | |
109 | } | |
110 | ||
5fd87823 | 111 | int systemctl_dispatch_parse_argv(int argc, char *argv[]); |