package io.rsocket.cli.util;

import io.rsocket.cli.UsageException;
import java.io.File;

public class FileUtil {
  public static File expectedFile(String name) {
    File file = new File(normalize(name));

    if (!file.isFile()) {
      throw new UsageException("setup file not found: " + file);
    }
    return file;
  }

  private static String normalize(String path) {
    if (path.startsWith("~/")) {
      return System.getenv("HOME") + "/" + path.substring(2);
    } else {
      return path;
    }
  }
}

@@ -262,14 +262,8 @@
 on(%22
-setup 
 file

remove false setup message