Skip to content

Commit 6f0738f

Browse files
authored
fix(CLI-OPTIONS): fix --help (#728)
1 parent 66cf8ae commit 6f0738f

3 files changed

Lines changed: 109 additions & 101 deletions

File tree

libs/scully-schematics/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libs/scully-schematics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@scullyio/init",
3-
"version": "0.0.28",
3+
"version": "0.0.29",
44
"description": "Add scully to your angular app",
55
"repository": {
66
"type": "GIT",

libs/scully/src/lib/utils/cli-options.ts

Lines changed: 107 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import * as yargs from 'yargs';
1+
import yargs from 'yargs';
22

33
export const {
4+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
5+
// @ts-ignore
46
watch,
57
removeStaticDist,
68
openNavigator,
@@ -10,8 +12,25 @@ export const {
1012
tds,
1113
proxyConfigFile,
1214
hostName,
15+
showBrowser,
16+
path,
17+
port,
18+
folder,
19+
sge,
20+
configFileName,
21+
project,
22+
baseFilter,
23+
routeFilter,
24+
scanRoutes,
25+
pjFirst,
26+
serverTimeout,
27+
pluginsError,
28+
handle404,
29+
prod,
1330
} =
1431
/** return the argv */
32+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
33+
// @ts-ignore
1534
yargs
1635
/** watch mode */
1736
.boolean('w')
@@ -59,107 +78,96 @@ export const {
5978
.string('hostName')
6079
.default('hostName', undefined)
6180
.alias('host', 'hostName')
62-
.describe('host', 'Add hostname for scully').argv;
81+
.describe('host', 'Add hostname for scully')
6382

64-
/** break up, bcs the linter doesn't like those long lists */
65-
export const { showBrowser, path, port, folder, sge } = yargs
83+
/** path */
84+
.string('path')
85+
.default('path', undefined)
86+
.alias('p', 'path')
87+
.describe('path', 'The path to generate')
88+
/** port */
89+
.number('port')
90+
.default('port', undefined)
91+
.alias('p', 'port')
92+
.describe('port', 'The port to run on')
93+
/** showBrowser */
94+
.boolean('sb')
95+
.alias('sb', 'showBrowser')
96+
.describe('sb', 'Shows the puppeteer controlled browser')
97+
/** folder */
98+
.string('folder')
99+
.default('folder', undefined)
100+
.describe('folder', 'folder')
101+
/** showGuessErrors */
102+
.boolean('sge')
103+
.alias('sge', 'showGuessError')
104+
.describe('sb', 'dumps the error from guess to the console')
66105

67-
/** path */
68-
.string('path')
69-
.default('path', undefined)
70-
.alias('p', 'path')
71-
.describe('path', 'The path to generate')
72-
/** port */
73-
.number('port')
74-
.default('port', undefined)
75-
.alias('p', 'port')
76-
.describe('port', 'The port to run on')
77-
/** showBrowser */
78-
.boolean('sb')
79-
.alias('sb', 'showBrowser')
80-
.describe('sb', 'Shows the puppeteer controlled browser')
81-
/** folder */
82-
.string('folder')
83-
.default('folder', undefined)
84-
.describe('folder', 'folder')
85-
/** showGuessErrors */
86-
.boolean('sge')
87-
.alias('sge', 'showGuessError')
88-
.describe('sb', 'dumps the error from guess to the console').argv;
89-
90-
export const {
91-
configFileName,
92-
project,
93-
baseFilter,
94-
routeFilter,
95-
scanRoutes,
96-
} = yargs /** config file */
97-
.string('cf')
98-
.alias('cf', 'configFile')
99-
.alias('cf', 'configFileName')
100-
.default('cf', '')
101-
.describe(
102-
'cf',
103-
'provide name of the config file to use. if the option --project is also there that takes precedence)'
104-
)
105-
/** projectName */
106-
.string('pr')
107-
.alias('pr', 'project')
108-
.default('pr', '')
109-
.describe('pr', 'provide name of the project to handle')
110-
/** scanRoutes */
111-
.boolean('sr')
112-
.default('sr', false)
113-
.alias('sr', 'scanRoutes')
114-
.alias('sr', 'scan')
115-
.describe('sr', 'Scan the app for unhandled routes')
116-
/** baseFilter */
117-
.string('bf')
118-
.alias('bf', 'baseFilter')
119-
.default('bf', '')
120-
.describe(
121-
'bf',
122-
'provide a wildcard string separated by ,(comma) to filter the unhandled routes'
123-
)
124-
/** filter */
125-
.string('routeFilter')
126-
.alias('routeFilter', 'rf')
127-
.default('routeFilter', '')
128-
.describe(
129-
'routeFilter',
130-
'provide a wildcard string separated by ,(comma) to filter the handled routes'
131-
).argv;
106+
.string('cf')
107+
.alias('cf', 'configFile')
108+
.alias('cf', 'configFileName')
109+
.default('cf', '')
110+
.describe(
111+
'cf',
112+
'provide name of the config file to use. if the option --project is also there that takes precedence)'
113+
)
114+
/** projectName */
115+
.string('pr')
116+
.alias('pr', 'project')
117+
.default('pr', '')
118+
.describe('pr', 'provide name of the project to handle')
119+
/** scanRoutes */
120+
.boolean('sr')
121+
.default('sr', false)
122+
.alias('sr', 'scanRoutes')
123+
.alias('sr', 'scan')
124+
.describe('sr', 'Scan the app for unhandled routes')
125+
/** baseFilter */
126+
.string('bf')
127+
.alias('bf', 'baseFilter')
128+
.default('bf', '')
129+
.describe(
130+
'bf',
131+
'provide a wildcard string separated by ,(comma) to filter the unhandled routes'
132+
)
133+
/** filter */
134+
.string('routeFilter')
135+
.alias('routeFilter', 'rf')
136+
.default('routeFilter', '')
137+
.describe(
138+
'routeFilter',
139+
'provide a wildcard string separated by ,(comma) to filter the handled routes'
140+
)
132141

133-
export const { pjFirst, serverTimeout, pluginsError, handle404, prod } = yargs
134-
/** server Timout */
135-
.number('st')
136-
.default('st', 0)
137-
.alias('st', 'serverTimeout')
138-
.describe(
139-
'st',
140-
'The time Scully will wait for the server before timeout. in milliseconds'
141-
)
142-
/** package json fist */
143-
.boolean('pjf')
144-
.default('pjf', false)
145-
.alias('pjf', 'pjFirst')
146-
.alias('pjf', 'pj-first')
147-
.describe('pjf', 'Scan for package.json first instead of angular.json')
148-
/** handle 404 in server */
149-
.string('handle404')
150-
.alias('handle404', '404')
151-
.default('handle404', '')
152-
.describe('handle404', 'determine how 404 is handled')
153-
/** Exit Scully with plugin error */
154-
.boolean('pe')
155-
.alias('pe', 'pluginsError')
156-
.default('pe', true)
157-
.describe('pe', "Exit scully's run when exist an error in a plugin")
158-
/** Use Prod Mode */
159-
.boolean('prod')
160-
.alias('prod', 'Production')
161-
.default('prod', false)
162-
.describe('prod', 'Use prod mode for Scully').argv;
142+
/** server Timout */
143+
.number('st')
144+
.default('st', 0)
145+
.alias('st', 'serverTimeout')
146+
.describe(
147+
'st',
148+
'The time Scully will wait for the server before timeout. in milliseconds'
149+
)
150+
/** package json fist */
151+
.boolean('pjf')
152+
.default('pjf', false)
153+
.alias('pjf', 'pjFirst')
154+
.alias('pjf', 'pj-first')
155+
.describe('pjf', 'Scan for package.json first instead of angular.json')
156+
/** handle 404 in server */
157+
.string('handle404')
158+
.alias('handle404', '404')
159+
.default('handle404', '')
160+
.describe('handle404', 'determine how 404 is handled')
161+
/** Exit Scully with plugin error */
162+
.boolean('pe')
163+
.alias('pe', 'pluginsError')
164+
.default('pe', true)
165+
.describe('pe', "Exit scully's run when exist an error in a plugin")
166+
/** Use Prod Mode */
167+
.boolean('prod')
168+
.alias('prod', 'Production')
169+
.default('prod', false)
170+
.describe('prod', 'Use prod mode for Scully').argv;
163171

164172
yargs.help();
165173

0 commit comments

Comments
 (0)