#include <stdint.h>
#include <stddef.h>
#include <ulib.h>

#define CMDS(X)                     \
  X(fetch)    X(mkf)    X(mkd)      \
  X(tree)     X(mount)  X(del)      \
  X(fmt)      X(unmount)

void main(void) {
  if (argslen() == 0) {
    return;
  }

  char *cmd = args()[0];

  #define X(name) if (string_strcmp(cmd, #name) == 0) { \
    extern void fs_ ## name(void); \
    fs_ ## name(); \
    return; \
  }
  CMDS(X)
  #undef X

  uprintf("fs: unknown command %s\n", cmd);
}
