@workover/cli 0.11.1 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/workover.mjs +14 -1
- package/package.json +1 -1
package/bin/workover.mjs
CHANGED
|
@@ -759,6 +759,7 @@ const DOC_USAGE = [
|
|
|
759
759
|
' [--file <path> | piped stdin] [--json]',
|
|
760
760
|
' propose <docId> [--note "<why>"] suggest a rewrite for review',
|
|
761
761
|
' [--file <path> | piped stdin] [--json] [--tab <tabId>]',
|
|
762
|
+
' [--why "<what was wrong>"] recorded as its reasoning',
|
|
762
763
|
' write <docId> [--note "<why>"] REPLACE the body, no review step',
|
|
763
764
|
' [--file <path> | piped stdin] [--json] [--tab <tabId>]',
|
|
764
765
|
' needs `workover login --write`; use it only when asked to',
|
|
@@ -779,6 +780,13 @@ const DOC_USAGE = [
|
|
|
779
780
|
' edits the document then and there — for when the person you are working with',
|
|
780
781
|
' said to make the change.',
|
|
781
782
|
'',
|
|
783
|
+
' Editing for propose: start from what `doc read` printed and change only the',
|
|
784
|
+
' words you mean to. Leave every other line exactly as printed, so the person',
|
|
785
|
+
' reviews your edit rather than a reformatting: tables print as HTML (edit the',
|
|
786
|
+
' text inside the cells, do not convert them to markdown tables), tasks as',
|
|
787
|
+
' `- [x]` / `- [ ]`, code in ``` fences. Do not reflow paragraphs, renumber',
|
|
788
|
+
' lists or change bullet markers.',
|
|
789
|
+
'',
|
|
782
790
|
' Tabs: a document can hold several separate bodies. read and write act on ONE',
|
|
783
791
|
' of them, so run `workover doc tabs <docId>` first and pass --tab; without it',
|
|
784
792
|
' you get the main body, which on a multi-tab document is not the whole thing.',
|
|
@@ -1021,7 +1029,8 @@ async function docCommand() {
|
|
|
1021
1029
|
}
|
|
1022
1030
|
|
|
1023
1031
|
if (sub === 'propose') {
|
|
1024
|
-
const usage =
|
|
1032
|
+
const usage =
|
|
1033
|
+
'workover doc propose <docId> --file <path> [--note "<summary>"] [--why "<what was wrong>"]';
|
|
1025
1034
|
const docId = docIdArg(positionals, usage);
|
|
1026
1035
|
const markdown = (await readBody(flags)).trim();
|
|
1027
1036
|
if (!markdown) {
|
|
@@ -1036,6 +1045,10 @@ async function docCommand() {
|
|
|
1036
1045
|
note: typeof flags.note === 'string' ? flags.note : undefined,
|
|
1037
1046
|
source: 'Workover CLI',
|
|
1038
1047
|
...(tabId === null ? {} : { tabId }),
|
|
1048
|
+
// "Why this change": what was wrong, shown to the reviewer beside the suggestion. Optional.
|
|
1049
|
+
...(typeof flags.why === 'string' && flags.why.trim()
|
|
1050
|
+
? { rationale: { problem: flags.why.trim() } }
|
|
1051
|
+
: {}),
|
|
1039
1052
|
});
|
|
1040
1053
|
if (asJson) return console.log(JSON.stringify(res, null, 2));
|
|
1041
1054
|
console.log(
|