diff --git a/packages/cli/__mocks__/term-size.js b/packages/cli/__mocks__/term-size.js
index 91477a62a..c6fb46ab1 100644
--- a/packages/cli/__mocks__/term-size.js
+++ b/packages/cli/__mocks__/term-size.js
@@ -1,3 +1,7 @@
-module.exports = function size() {
+function size() {
return { columns: 80, rows: 80 };
-};
+}
+
+size.size = size;
+
+module.exports = size;
diff --git a/packages/cli/tests/__snapshots__/Failure.test.tsx.snap b/packages/cli/tests/__snapshots__/Failure.test.tsx.snap
index 16c481d59..dda8c6d25 100644
--- a/packages/cli/tests/__snapshots__/Failure.test.tsx.snap
+++ b/packages/cli/tests/__snapshots__/Failure.test.tsx.snap
@@ -2,106 +2,28 @@
exports[` > doesnt render code frame if a common error 1`] = `
"
- [41m[37m ERROR [49m[39m Cannot read properties of undefined (reading 'columns')
-
- [2msrc/components/Failure.tsx:57:29[22m
-
- [2m54:[22m return null;
- [2m55:[22m }
- [2m56:[22m
- [41m[37m57:[49m[39m[41m[37m const width = screen.size().columns;[39m[49m
- [2m58:[22m let type: StyleType = 'failure';
- [2m59:[22m let cmd = \`\${delimiter}\${binName} \${commandLine}\`;
- [2m60:[22m let arg = '';
-
- [2m- [22m[1m[2mFailure.renderCodeFrame[22m[90m[2m (src/components/Failure.tsx:57:29)[22m[39m[1m
- [2m- [22m[1m[2mFailure.render[22m[90m[2m (src/components/Failure.tsx:164:12)[22m[39m[1m
- [2m-[22m[1m[2mfinishClassCompo[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.[22m[39m[1m
- [1m[2ment[22m[1m[22m [22m[90m[2mdevelopment.js:8912:31)[22m[39m[1m
- [2m-[22m[1m[2mupdateClassCompo[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.[22m[39m[1m
- [1m[2ment[22m[1m[22m [22m[90m[2mdevelopment.js:8862:24)[22m[39m[1m
- [2m-[22m[1m[2mbeginWor[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.developm[22m[39m[1m
- [90m[2ment.js:10500:16)[22m[39m
- [2m-[22m[1m[2mObject.invokeGuardedCall[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-rec[22m[39m[1m
- [1m[2mackProd[22m[1m[22m [22m[90m[2monciler.development.js:12101:10)[22m[39m[1m
- [2m-[22m[1m[2minvokeGuardedCall[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler[22m[39m[1m
- [1m[2mack[22m[1m[22m [22m[90m[2m.development.js:12292:31)[22m[39m[1m
- [2m-[22m[1m[2mbeginWork$[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.develo[22m[39m[1m
- [90m[2mpment.js:16531:7)[22m[39m
- [2m-[22m[1m[2mperformUnitOfW[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.de[22m[39m[1m
- [1m[2mrk[22m[1m[22m [22m[90m[2mvelopment.js:15340:12)[22m[39m[1m
- [2m-[22m[1m[2mworkLoopSyn[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.devel[22m[39m[1m
- [90m[2mopment.js:15268:5)[22m[39m
+[1m[41m[30m ERROR [39m[49m[22m
+
+ Something is broken!
"
`;
exports[` > doesnt render code frame if arg not found 1`] = `
"
- [41m[37m ERROR [49m[39m Cannot read properties of undefined (reading 'columns')
-
- [2msrc/components/Failure.tsx:57:29[22m
-
- [2m54:[22m return null;
- [2m55:[22m }
- [2m56:[22m
- [41m[37m57:[49m[39m[41m[37m const width = screen.size().columns;[39m[49m
- [2m58:[22m let type: StyleType = 'failure';
- [2m59:[22m let cmd = \`\${delimiter}\${binName} \${commandLine}\`;
- [2m60:[22m let arg = '';
-
- [2m- [22m[1m[2mFailure.renderCodeFrame[22m[90m[2m (src/components/Failure.tsx:57:29)[22m[39m[1m
- [2m- [22m[1m[2mFailure.render[22m[90m[2m (src/components/Failure.tsx:164:12)[22m[39m[1m
- [2m-[22m[1m[2mfinishClassCompo[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.[22m[39m[1m
- [1m[2ment[22m[1m[22m [22m[90m[2mdevelopment.js:8912:31)[22m[39m[1m
- [2m-[22m[1m[2mupdateClassCompo[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.[22m[39m[1m
- [1m[2ment[22m[1m[22m [22m[90m[2mdevelopment.js:8862:24)[22m[39m[1m
- [2m-[22m[1m[2mbeginWor[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.developm[22m[39m[1m
- [90m[2ment.js:10500:16)[22m[39m
- [2m-[22m[1m[2mObject.invokeGuardedCall[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-rec[22m[39m[1m
- [1m[2mackProd[22m[1m[22m [22m[90m[2monciler.development.js:12101:10)[22m[39m[1m
- [2m-[22m[1m[2minvokeGuardedCall[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler[22m[39m[1m
- [1m[2mack[22m[1m[22m [22m[90m[2m.development.js:12292:31)[22m[39m[1m
- [2m-[22m[1m[2mbeginWork$[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.develo[22m[39m[1m
- [90m[2mpment.js:16531:7)[22m[39m
- [2m-[22m[1m[2mperformUnitOfW[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.de[22m[39m[1m
- [1m[2mrk[22m[1m[22m [22m[90m[2mvelopment.js:15340:12)[22m[39m[1m
- [2m-[22m[1m[2mworkLoopSyn[22m[90m[2m (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.devel[22m[39m[1m
- [90m[2mopment.js:15268:5)[22m[39m
+[1m[41m[30m ERROR [39m[49m[22m
+
+ Flags and short option groups may not use inline values.
"
`;
exports[` > reduces command line by half when index appears off screen 1`] = `
"
- ERROR Cannot read properties of undefined (reading 'columns')
-
- src/components/Failure.tsx:57:29
-
- 54: return null;
- 55: }
- 56:
- 57: const width = screen.size().columns;
- 58: let type: StyleType = 'failure';
- 59: let cmd = \`\${delimiter}\${binName} \${commandLine}\`;
- 60: let arg = '';
-
- - Failure.renderCodeFrame (src/components/Failure.tsx:57:29)
- - Failure.render (src/components/Failure.tsx:164:12)
- -finishClassCompo (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.
- ent development.js:8912:31)
- -updateClassCompo (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.
- ent development.js:8862:24)
- -beginWor (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.developm
- ent.js:10500:16)
- -Object.invokeGuardedCall (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-rec
- ackProd onciler.development.js:12101:10)
- -invokeGuardedCall (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler
- ack .development.js:12292:31)
- -beginWork$ (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.develo
- pment.js:16531:7)
- -performUnitOfW (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.de
- rk velopment.js:15340:12)
- -workLoopSyn (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.devel
- opment.js:15268:5)
+ ERROR
+
+ Flags and short option groups may not use inline values.
+
+ … wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww" --flag=123 -gSA "mmmmmmmmmmmm …
+ └────────┘
"
`;
@@ -123,36 +45,12 @@ exports[` > renders a parse error 1`] = `
exports[` > renders a parse error with a command line 1`] = `
"
- ERROR Cannot read properties of undefined (reading 'columns')
-
- src/components/Failure.tsx:57:29
-
- 54: return null;
- 55: }
- 56:
- 57: const width = screen.size().columns;
- 58: let type: StyleType = 'failure';
- 59: let cmd = \`\${delimiter}\${binName} \${commandLine}\`;
- 60: let arg = '';
-
- - Failure.renderCodeFrame (src/components/Failure.tsx:57:29)
- - Failure.render (src/components/Failure.tsx:164:12)
- -finishClassCompo (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.
- ent development.js:8912:31)
- -updateClassCompo (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.
- ent development.js:8862:24)
- -beginWor (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.developm
- ent.js:10500:16)
- -Object.invokeGuardedCall (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-rec
- ackProd onciler.development.js:12101:10)
- -invokeGuardedCall (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler
- ack .development.js:12292:31)
- -beginWork$ (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.develo
- pment.js:16531:7)
- -performUnitOfW (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.de
- rk velopment.js:15340:12)
- -workLoopSyn (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.devel
- opment.js:15268:5)
+ ERROR
+
+ Flags and short option groups may not use inline values.
+
+ $ boost --foo value --flag=123 -gSA
+ └────────┘
"
`;
@@ -166,35 +64,11 @@ exports[` > renders a validation error 1`] = `
exports[` > renders a validation error with a command line 1`] = `
"
- ERROR Cannot read properties of undefined (reading 'columns')
-
- src/components/Failure.tsx:57:29
-
- 54: return null;
- 55: }
- 56:
- 57: const width = screen.size().columns;
- 58: let type: StyleType = 'failure';
- 59: let cmd = \`\${delimiter}\${binName} \${commandLine}\`;
- 60: let arg = '';
-
- - Failure.renderCodeFrame (src/components/Failure.tsx:57:29)
- - Failure.render (src/components/Failure.tsx:164:12)
- -finishClassCompo (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.
- ent development.js:8912:31)
- -updateClassCompo (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.
- ent development.js:8862:24)
- -beginWor (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.developm
- ent.js:10500:16)
- -Object.invokeGuardedCall (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-rec
- ackProd onciler.development.js:12101:10)
- -invokeGuardedCall (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler
- ack .development.js:12292:31)
- -beginWork$ (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.develo
- pment.js:16531:7)
- -performUnitOfW (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.de
- rk velopment.js:15340:12)
- -workLoopSyn (/Users/miles/Projects/boost/node_modules/react-reconciler/cjs/react-reconciler.devel
- opment.js:15268:5)
+ ERROR
+
+ Not enough arity arguments.
+
+ $ boost --foo value --flag=123 -gSA
+ └───┘
"
`;
diff --git a/packages/cli/tests/__snapshots__/Program.test.tsx.snap b/packages/cli/tests/__snapshots__/Program.test.tsx.snap
index e79a3f2c2..8b6dc0a4b 100644
--- a/packages/cli/tests/__snapshots__/Program.test.tsx.snap
+++ b/packages/cli/tests/__snapshots__/Program.test.tsx.snap
@@ -63,7 +63,7 @@ exports[` > exit > renders a non-zero exit 1`] = `
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Fail!
"
`;
@@ -80,7 +80,7 @@ exports[` > failure > renders if an error is thrown 1`] = `
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Broken!
"
`;
@@ -88,7 +88,10 @@ exports[` > failure > renders when args parsing fails 1`] = `
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Unknown option "--foo" found. Did you mean "help"? [ARG:OPTION_UNKNOWN_MORE]
+
+ [90m$ boost [31m--foo[39m[90m[39m
+ [31m └───┘[39m
"
`;
@@ -96,7 +99,7 @@ exports[` > failure > renders when invalid command name passed 1`] =
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Unknown command "prune". Did you mean "build"? [CLI:COMMAND_UNKNOWN]
"
`;
@@ -104,7 +107,7 @@ exports[` > failure > renders when misspelt command name passed 1`] =
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Unknown command "buld". Did you mean "build"? [CLI:COMMAND_UNKNOWN]
"
`;
@@ -112,7 +115,7 @@ exports[` > failure > renders when no commands could be found 1`] = `
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Failed to determine a command to run. [CLI:COMMAND_INVALID_RUN]
"
`;
@@ -120,7 +123,8 @@ exports[` > failure > renders when no commands have been registered 1
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ No commands have been registered. At least 1 is required.
+ [CLI:COMMAND_NONE_REGISTERED]
"
`;
@@ -128,7 +132,7 @@ exports[` > failure > renders with custom exit error 1`] = `
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Oops
"
`;
@@ -383,7 +387,10 @@ exports[` > locale > errors for invalid \`--locale\` 1`] = `
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Locale must be in the format of "en" or "en-US".
+
+ [90m$ boost [33m--locale[39m[90m wtf[39m
+ [33m └──────┘[39m
"
`;
@@ -414,7 +421,7 @@ exports[` > nested programs > bubbles up errors 1`] = `
"
[1m[41m[30m ERROR [39m[49m[22m
- Cannot read properties of undefined (reading 'columns')
+ Bubbles
"
`;