summaryrefslogtreecommitdiff
path: root/Userland/shutdown.cpp
blob: 7884f12c153a7ac978f063992538434b9e234b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <Kernel/Syscall.h>
#include <LibCore/CArgsParser.h>

int main(int argc, char** argv)
{
    CArgsParser args_parser("shutdown");
    args_parser.add_arg("n", "shut down now");
    CArgsParserResult args = args_parser.parse(argc, (const char**)argv);

    if (args.is_present("n")) {
        syscall(SC_halt);
        return 0;
    } else {
        args_parser.print_usage();
        return 0;
    }
}