📄 dhcpcommand.java
字号:
/*
* $Id: DhcpCommand.java,v 1.1 2004/02/17 20:51:12 markhale Exp $
*/
package org.jnode.net.command;
import org.jnode.driver.Device;
import org.jnode.net.ipv4.dhcp.DHCPClient;
import org.jnode.shell.help.DeviceArgument;
import org.jnode.shell.help.Help;
import org.jnode.shell.help.Parameter;
import org.jnode.shell.help.ParsedArguments;
/**
* @author markhale
*/
public class DhcpCommand {
static final DeviceArgument ARG_DEVICE = new DeviceArgument("device", "the device to boot from");
public static Help.Info HELP_INFO = new Help.Info(
"dhcp",
"Try to configure the given device using DHCP",
new Parameter[]{
new Parameter(ARG_DEVICE, Parameter.MANDATORY)
}
);
public static void main(String[] args)
throws Exception {
ParsedArguments cmdLine = HELP_INFO.parse(args);
Device dev = ARG_DEVICE.getDevice(cmdLine);
System.out.println("Trying to configure " + dev.getId() + "...");
final DHCPClient client = new DHCPClient();
client.configureDevice(dev);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -