Setup cli routing & other cleanup.

This commit is contained in:
2026-08-06 23:21:38 +01:00
parent 04a27b30aa
commit fdb67b449d
9 changed files with 135 additions and 28 deletions
+9
View File
@@ -0,0 +1,9 @@
#pragma once
#include "pch.h"
namespace crib::cli {
extern bool use_colors;
void help();
int run(int argc, char *argv[]);
} // namespace crib::cli
-3
View File
@@ -1,3 +0,0 @@
#pragma once
#include "pch.h"
+6
View File
@@ -2,3 +2,9 @@
#include "internal/vase/vase.h"
#include "pch.h"
namespace crib::commands::ed {
std::string summary();
void help();
void run(int argc, char *argv[]);
} // namespace crib::commands::ed
+21 -21
View File
@@ -18,28 +18,28 @@ struct Range {
Point end;
};
struct RegexGroup {
uint64_t start{UINT32_MAX};
uint64_t end{UINT32_MAX};
};
struct RegexMatch {
uint64_t start;
uint64_t end;
RegexGroup groups[9]{};
};
struct ReplacePart {
enum struct PartType {
FullMatch,
CaptureGroup,
Constant
} type;
std::variant<uint8_t, Shard *> value;
};
struct Vase {
struct RegexGroup {
uint64_t start{0};
uint64_t end{0};
};
struct RegexMatch {
uint64_t start;
uint64_t end;
RegexGroup groups[9]{};
};
struct ReplacePart {
enum struct PartType {
FullMatch,
CaptureGroup,
Constant
} type;
std::variant<uint8_t, Shard *> value;
};
OriginalBuffer *original;
AppendBuffer *append;
Shard *root;