1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +00:00

Userland: Add a /bin/basename program.

This commit is contained in:
Andreas Kling 2019-04-15 13:57:09 +02:00
parent 024057b39a
commit 87c4d2bc92

12
Userland/basename.cpp Normal file
View file

@ -0,0 +1,12 @@
#include <AK/FileSystemPath.h>
#include <stdio.h>
int main(int argc, char** argv)
{
if (argc != 2) {
printf("usage: basename <path>\n");
return 1;
}
printf("%s\n", FileSystemPath(argv[1]).basename().characters());
return 0;
}