Ayaka Koshibe
Committed by Gerrit Code Review

Check for standalone device IDs as args for `paths` command

Change-Id: Ia821345bbee2a9910d64fa37e033dec60d0da869
...@@ -50,6 +50,10 @@ public class PathListCommand extends TopologyCommand { ...@@ -50,6 +50,10 @@ public class PathListCommand extends TopologyCommand {
50 @Override 50 @Override
51 protected void execute() { 51 protected void execute() {
52 init(); 52 init();
53 + if (src.split("/").length != 1 || dst.split("/").length != 1) {
54 + print("Expected device IDs as arguments");
55 + return;
56 + }
53 Set<Path> paths = service.getPaths(topology, deviceId(src), deviceId(dst)); 57 Set<Path> paths = service.getPaths(topology, deviceId(src), deviceId(dst));
54 if (outputJson()) { 58 if (outputJson()) {
55 print("%s", json(this, paths)); 59 print("%s", json(this, paths));
......