An Electron-based JLD2 data file viewer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.jl 569B

12345678910111213141516171819202122232425262728
  1. import Pkg; Pkg.activate(@__DIR__, io=devnull)
  2. using JLD2View
  3. using NativeFileDialog
  4. path = get(ARGS, 1) do
  5. pick_file(filterlist="jld2")
  6. end
  7. const HELP = """
  8. Usage:
  9. jld2view [JLD2_PATH]
  10. Display the contents of a JLD2 file. If no file is provided in the command line,
  11. a file-picker dialog box will appear to select one interactively.
  12. """
  13. if path == "--help"
  14. println(HELP)
  15. exit(0)
  16. elseif path == "" # pick_file cancelled
  17. exit(0)
  18. elseif isfile(path)
  19. jld2_view(path)
  20. else
  21. @error "File not found" path
  22. println("\n", HELP)
  23. exit(1)
  24. end