Files
jsix_import/src/user/6s/commands.h
Justin C. Miller eb62588b79 [6s] Allow 6s to know about filesystems
Added a j6_proto_vfs_tag/_get_tag pair of messages to the VFS protocol
to allow filesystems to label themselves, and gave 6s the concept of
current fs and current working directory.
2024-04-30 22:23:04 -07:00

29 lines
514 B
C++

#pragma once
#include <stddef.h>
struct shell;
class builtin
{
public:
using runf = void (*)(shell &);
builtin(const char *name, const char *desc, runf func) :
m_name {name}, m_desc {desc}, m_func {func} {}
const char * name() const { return m_name; }
const char * description() const { return m_desc; }
void run(shell &s) { m_func(s); }
private:
const char *m_name;
const char *m_desc;
runf m_func;
};
extern builtin g_builtins[];
extern size_t g_builtins_count;