main.myr 670 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. use std
  2. use "cp"
  3. use "dispatch"
  4. use "dateutil"
  5. use "mkdir"
  6. use "ls"
  7. use "echo"
  8. use "cat"
  9. use "rm"
  10. use "httpd"
  11. use "sha256sum"
  12. use "sleeputil"
  13. use "uname"
  14. use "whoami"
  15. const main = {args : byte[:][:]
  16. const program = "milisbox"
  17. var cmd
  18. var params
  19. cmd = args[0]
  20. //if std.eq(args[0], "somestring")
  21. cmd = std.basename(cmd)
  22. std.put("progname: {}\n", cmd)
  23. match cmd
  24. | program :
  25. std.put("{} {}\n",program," 0.1 info")
  26. cmd = args[1]
  27. params = args[2:]
  28. | _:
  29. std.put("{} {} {}\n",program,cmd,"0.1 info")
  30. params = args[1:]
  31. ;;
  32. std.put("call {} with these: {}\n",cmd,params)
  33. if !dispatch.call(cmd,params)
  34. std.put("unknown command: {}\n", cmd)
  35. ;;
  36. }