mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
Userland: Add a /bin/basename program.
This commit is contained in:
12
Userland/basename.cpp
Normal file
12
Userland/basename.cpp
Normal 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user