mirror of
https://gitee.com/arthas/arthas.git
synced 2024-11-30 11:17:39 +08:00
add pwd command. #493
This commit is contained in:
parent
73e5f15adb
commit
793df05b2f
@ -4,6 +4,7 @@ import com.taobao.arthas.core.command.basic1000.ClsCommand;
|
||||
import com.taobao.arthas.core.command.basic1000.HelpCommand;
|
||||
import com.taobao.arthas.core.command.basic1000.HistoryCommand;
|
||||
import com.taobao.arthas.core.command.basic1000.KeymapCommand;
|
||||
import com.taobao.arthas.core.command.basic1000.PwdCommand;
|
||||
import com.taobao.arthas.core.command.basic1000.ResetCommand;
|
||||
import com.taobao.arthas.core.command.basic1000.SessionCommand;
|
||||
import com.taobao.arthas.core.command.basic1000.ShutdownCommand;
|
||||
@ -85,5 +86,6 @@ public class BuiltinCommandPack implements CommandResolver {
|
||||
commands.add(Command.create(SystemPropertyCommand.class));
|
||||
commands.add(Command.create(SystemEnvCommand.class));
|
||||
commands.add(Command.create(HistoryCommand.class));
|
||||
commands.add(Command.create(PwdCommand.class));
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.taobao.arthas.core.command.basic1000;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.taobao.arthas.core.shell.command.AnnotatedCommand;
|
||||
import com.taobao.arthas.core.shell.command.CommandProcess;
|
||||
import com.taobao.middleware.cli.annotations.Name;
|
||||
import com.taobao.middleware.cli.annotations.Summary;
|
||||
|
||||
@Name("pwd")
|
||||
@Summary("Return working directory name")
|
||||
public class PwdCommand extends AnnotatedCommand {
|
||||
@Override
|
||||
public void process(CommandProcess process) {
|
||||
process.write(new File("").getAbsolutePath()).write("\n");
|
||||
process.end();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user