summaryrefslogtreecommitdiff
path: root/Userland/umount.cpp
blob: 31fb4725597138eac6bf4043e9610995a2e2334b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <LibCore/CArgsParser.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char** argv)
{
    CArgsParser args_parser("umount");
    args_parser.add_arg("mountpoint", "mount point");
    CArgsParserResult args = args_parser.parse(argc, argv);

    if (argc == 2) {
        if (umount(argv[1]) < 0) {
            perror("umount");
            return 1;
        }
    } else {
        args_parser.print_usage();
        return 0;
    }

    return 0;
}