Update CLI usage text

This commit is contained in:
John Wu 2022-01-20 01:58:11 -08:00
parent 6582a4abd9
commit c826318da4

View File

@ -4,30 +4,29 @@
#include "sepolicy.hpp" #include "sepolicy.hpp"
using namespace std::literals; using namespace std;
[[noreturn]] static void usage(char *arg0) { [[noreturn]] static void usage(char *arg0) {
fprintf(stderr, fprintf(stderr,
R"EOF(MagiskPolicy - Sepolicy Patch Tool R"EOF(MagiskPolicy - SELinux Policy Patch Tool
Usage: %s [--options...] [policy statements...] Usage: %s [--options...] [policy statements...]
Options: Options:
--help show help message for policy statements --help show help message for policy statements
--load FILE load policies from FILE --load FILE load monolithic sepolicy from FILE
--load-split load from precompiled sepolicy or compile --load-split load from precompiled sepolicy or compile
split policies split cil policies
--compile-split compile split cil policies --compile-split compile split cil policies
--save FILE save policies to FILE --save FILE dump monolithic sepolicy to FILE
--live directly apply sepolicy live --live immediately load sepolicy into the kernel
--magisk inject built-in rules for a minimal --magisk apply built-in Magisk sepolicy rules
Magisk selinux environment
--apply FILE apply rules from FILE, read and parsed --apply FILE apply rules from FILE, read and parsed
line by line as policy statements line by line as policy statements
(multiple --apply allows) (multiple --apply are allowed)
If neither --load or --compile-split is specified, it will load If neither --load, --load-split, nor --compile-split is specified,
from current live policies (/sys/fs/selinux/policy) it will load from current live policies (/sys/fs/selinux/policy)
)EOF", arg0); )EOF", arg0);
exit(1); exit(1);
@ -36,7 +35,7 @@ from current live policies (/sys/fs/selinux/policy)
int magiskpolicy_main(int argc, char *argv[]) { int magiskpolicy_main(int argc, char *argv[]) {
cmdline_logging(); cmdline_logging();
const char *out_file = nullptr; const char *out_file = nullptr;
std::vector<std::string_view> rule_files; vector<string_view> rule_files;
sepolicy *sepol = nullptr; sepolicy *sepol = nullptr;
bool magisk = false; bool magisk = false;
bool live = false; bool live = false;