Repository: iterative/cml
Pull request #1210 (2022-10-07 13:44:47)

CLI consistency: --native => --publish-native
- `--native` => `--publish-native`
- ~cleanup pr `<glob path>`~



Patch:
diff --git a/bin/cml/comment/create.js b/bin/cml/comment/create.js
index b325b45..c0dea33 100644
--- a/bin/cml/comment/create.js
+++ b/bin/cml/comment/create.js
@@ -26,6 +26,15 @@ exports.options = kebabcaseKeys({
     default: 'HEAD',
     description: 'Commit SHA linked to this comment'
   },
+  watch: {
+    type: 'boolean',
+    description: 'Watch for changes and automatically update the comment'
+  },
+  triggerFile: {
+    type: 'string',
+    description: 'File used to trigger the watcher',
+    hidden: true
+  },
   publish: {
     type: 'boolean',
     default: true,
@@ -37,17 +46,9 @@ exports.options = kebabcaseKeys({
     description: 'Self-hosted image server URL',
     telemetryData: 'name'
   },
-  watch: {
-    type: 'boolean',
-    description: 'Watch for changes and automatically update the comment'
-  },
-  triggerFile: {
-    type: 'string',
-    description: 'File used to trigger the watcher',
-    hidden: true
-  },
-  native: {
+  publishNative: {
     type: 'boolean',
+    alias: 'native',
     description:
       "Uses driver's native capabilities to upload assets instead of CML's storage; not available on GitHub",
     telemetryData: 'name'


Test patch:
diff --git a/bin/cml/comment/create.test.js b/bin/cml/comment/create.test.js
index e9245a4..681ae8b 100644
--- a/bin/cml/comment/create.test.js
+++ b/bin/cml/comment/create.test.js
@@ -18,21 +18,21 @@ describe('Comment integration tests', () => {
         --help    Show help                                                  [boolean]
 
       Options:
-        --pr                      Post to an existing PR/MR associated with the
-                                  specified commit                           [boolean]
-        --commit-sha, --head-sha  Commit SHA linked to this comment
+        --pr                        Post to an existing PR/MR associated with the
+                                    specified commit                         [boolean]
+        --commit-sha, --head-sha    Commit SHA linked to this comment
                                                             [string] [default: \\"HEAD\\"]
-        --publish                 Upload any local images found in the Markdown report
-                                                             [boolean] [default: true]
-        --publish-url             Self-hosted image server URL
+        --watch                     Watch for changes and automatically update the
+                                    comment                                  [boolean]
+        --publish                   Upload any local images found in the Markdown
+                                    report                   [boolean] [default: true]
+        --publish-url               Self-hosted image server URL
                                            [string] [default: \\"https://asset.cml.dev\\"]
-        --watch                   Watch for changes and automatically update the
-                                  comment                                    [boolean]
-        --native                  Uses driver's native capabilities to upload assets
-                                  instead of CML's storage; not available on GitHub
+        --publish-native, --native  Uses driver's native capabilities to upload assets
+                                    instead of CML's storage; not available on GitHub
                                                                              [boolean]
-        --rm-watermark            Avoid watermark; CML needs a watermark to be able to
-                                  distinguish CML comments from others       [boolean]"
+        --rm-watermark              Avoid watermark; CML needs a watermark to be able
+                                    to distinguish CML comments from others  [boolean]"
     `);
   });
 });