Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/com/mycmd/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private static void registerCommands(Map<String, Command> commands) {
commands.put("help", new HelpCommand(commands));
commands.put("exit", new ExitCommand());
commands.put("ver", new VersionCommand());
commands.put("whoami", new WhoamiCommand());
commands.put("touch", new TouchCommand());
commands.put("time", new TimeCommand());
commands.put("date", new DateCommand());
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/mycmd/commands/WhoamiCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.mycmd.commands;

import com.mycmd.Command;
import com.mycmd.ShellContext;

public class WhoamiCommand implements Command {
@Override
public void execute(String[] args, ShellContext context) {
System.out.println(System.getProperty("user.name"));
}
}