Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ node_modules
# compiled binary
bin/recs

# generated man pages (use `recs install-manpages` to install)
man/

# output
out
dist
Expand Down
17 changes: 17 additions & 0 deletions bin/recs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,23 @@ if (command === "--version" || command === "-V") {
process.exit(0);
}

if (command === "install-manpages") {
const { generateManPages } = await import("../scripts/generate-manpages.ts");
const { join } = await import("node:path");
const { homedir } = await import("node:os");
const manDir = join(homedir(), ".local", "share", "man", "man1");
const count = await generateManPages(manDir);
console.log(`Installed ${count} man pages to ${manDir}`);

const manpath = process.env["MANPATH"] ?? "";
const manParent = join(homedir(), ".local", "share", "man");
if (!manpath.includes(manParent)) {
console.log(`\nHint: add ${manParent} to your MANPATH:`);
console.log(` export MANPATH="${manParent}:${"$"}MANPATH"`);
}
process.exit(0);
}

if (command === "--list" || command === "-l" || command === "list") {
const docs = loadAllDocs();
for (const doc of docs.sort((a, b) => a.name.localeCompare(b.name))) {
Expand Down
43 changes: 0 additions & 43 deletions man/man1/recs-annotate.1

This file was deleted.

46 changes: 0 additions & 46 deletions man/man1/recs-assert.1

This file was deleted.

43 changes: 0 additions & 43 deletions man/man1/recs-chain.1

This file was deleted.

110 changes: 0 additions & 110 deletions man/man1/recs-collate.1

This file was deleted.

46 changes: 0 additions & 46 deletions man/man1/recs-decollate.1

This file was deleted.

32 changes: 0 additions & 32 deletions man/man1/recs-delta.1

This file was deleted.

Loading