struggle
This commit is contained in:
@@ -80,6 +80,22 @@ async function renameFields(
|
||||
}
|
||||
}
|
||||
|
||||
class RenameFields implements ITool {
|
||||
name = "renamefields";
|
||||
description = "Renames fields in a PDF form";
|
||||
help() {
|
||||
console.log("Usage: renamefields <pdfPath> <pattern> <change>");
|
||||
}
|
||||
async run(pdfPath: string = "", pattern: string = "", change: string = "") {
|
||||
await callWithArgPrompt(renameFields, [
|
||||
["Please provide path to PDF:", (p) => !!p && p.endsWith(".pdf")],
|
||||
"Please provide search string:",
|
||||
"Please provide requested change:",
|
||||
], [pdfPath, pattern, change]);
|
||||
}
|
||||
}
|
||||
export default new RenameFields();
|
||||
|
||||
if (import.meta.main) {
|
||||
// await call(renameFields)
|
||||
// while (!path || !path.endsWith('.pdf')) path = prompt("Please provide path to PDF:") || '';
|
||||
|
Reference in New Issue
Block a user