dedent template literals
MODIFY
packages/@romejs/cli-flags/Parser.ts
packages/@romejs/cli-flags/Parser.ts
@@ -16,6 +16,7 @@ import {
} from '@romejs/consume';
import {naturalCompare, toCamelCase, toKebabCase} from '@romejs/string-utils';
import {createUnknownFilePath} from '@romejs/path';
+import {dedent} from '@romejs/string-utils';
import {Dict} from '@romejs/typescript-helpers';
import {markup} from '@romejs/string-markup';
import {descriptions} from '@romejs/diagnostics';
@@ -668,7 +669,7 @@ export default class Parser<T> {
}
for (let [cmd, flags] of cmdFlagMap.entries()) {
- commandFuncs += `__rome_${cmd}()
+ commandFuncs += dedent`__rome_${cmd}()
{
cmds="";
local_flags="${flags}"
@@ -677,7 +678,7 @@ export default class Parser<T> {
`;
}
- let romeFunc = `__rome()
+ let romeFunc = dedent`__rome()
{
cmds="${romeCmds}"
local_flags="";
@@ -685,7 +686,7 @@ export default class Parser<T> {
`;
- return `#!/usr/bin/env bash
+ return dedent`#!/usr/bin/env bash
global_flags="${globalFlags}"
# initial state

dedent template literals