summary refs log tree commit diff stats
path: root/overlays/node-packages/prettierd.patch
blob: 9abb572d651622ad150b36128dbacf2255fd9b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
diff --git a/src/service.ts b/src/service.ts
index 93164e5..eafc38f 100644
--- a/src/service.ts
+++ b/src/service.ts
@@ -153,8 +153,26 @@ function parseCLIArguments(args: string[]): [CLIArguments, string, CliOptions] {
           parsedArguments.ignorePath = nextArg.value;
           break;
         }
+        case "--stdin-filepath": {
+          const nextArg = argsIterator.next();
+          if (nextArg.done) {
+            throw new Error("--stdin-filepath option expects a file path");
+          }
+
+          fileName = nextArg.value;
+          break;
+        }
         default: {
-          optionArgs.push(arg);
+          if (arg.includes("=")) {
+            optionArgs.push(arg);
+          } else {
+            const nextArg = argsIterator.next();
+            if (nextArg.done) {
+              throw new Error(`--${arg} expects a value`);
+            }
+
+            optionArgs.push(`${arg}=${nextArg.value}`);
+          }
         }
       }
     } else {