summaryrefslogtreecommitdiff
path: root/Source/Applications/Shell/Applets/pwd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Applications/Shell/Applets/pwd.cpp')
-rw-r--r--Source/Applications/Shell/Applets/pwd.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Applications/Shell/Applets/pwd.cpp b/Source/Applications/Shell/Applets/pwd.cpp
new file mode 100644
index 0000000..4b27eb0
--- /dev/null
+++ b/Source/Applications/Shell/Applets/pwd.cpp
@@ -0,0 +1,15 @@
+#include <App/ShellApp.proto.h>
+#include <Binding/FSNode.class.h>
+
+class pwd : public ShellApp {
+ public:
+ pwd() : ShellApp("pwd", "Shows the current directory") {
+ addFlag("f", "frugal", "Do not show 'Current directory: ' prefix", FT_BOOL, "");
+ }
+ int run() {
+ if (!bFlag("frugal")) outvt << "Current directory: ";
+ outvt << FS::cwdNode().path() << ENDL;
+ }
+};
+
+APP(pwd);