Skip to content

Commit

Permalink
Userland: Add a /bin/basename program.
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Apr 15, 2019
1 parent 024057b commit 87c4d2b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Userland/basename.cpp
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 87c4d2b

Please sign in to comment.