@@ -142,38 +142,43 @@ function handleDisplayConfig(field) {
142142 }
143143}
144144
145+ function getProgramName ( ) {
146+ let name = path . basename ( process . argv [ 1 ] ) ;
147+ return pkg . bin [ name ] ? name : 'cssd' ;
148+ }
149+
145150program
146- . name ( 'css-doodle' )
151+ . name ( getProgramName ( ) )
147152 . description ( pkg . description )
148153 . version ( pkg . version ) ;
149154
150155program
151156 . command ( 'render' )
152- . description ( 'generate an image from the CSS Doodle source file' )
153- . argument ( '[source]' , 'the CSS Doodle source file used to generate the image' )
157+ . description ( 'generate an image from css-doodle file' )
158+ . argument ( '[source]' , 'css-doolde source file used to generate the image' )
154159 . option ( '-o, --output <output>' , 'custom filename of the generated image' )
155160 . option ( '-x, --scale <scale>' , 'scale factor of the generated image, defaults to 1' )
156161 . action ( ( source , options ) => {
157162 handleRender ( source , options ) ;
158163 } ) ;
159164
160165program . command ( 'preview' )
161- . description ( 'open a window to preview the CSS Doodle file' )
162- . argument ( '<source>' , 'source file to preview' )
166+ . description ( 'open a window to preview the css-doodle file' )
167+ . argument ( '<source>' , 'css-doodle source file to preview' )
163168 . option ( '--fullscreen' , 'open the preview in fullscreen mode' )
164169 . action ( ( source , options ) => {
165170 handlePreview ( source , options ) ;
166171 } ) ;
167172
168173program . command ( 'parse' )
169174 . description ( 'print the parsed tokens, helped to debug on development' )
170- . argument ( '[source]' , 'source file to parse' )
175+ . argument ( '[source]' , 'css-doodle source file to parse' )
171176 . action ( ( source ) => {
172177 handleParse ( source ) ;
173178 } ) ;
174179
175180program . command ( 'config' )
176- . description ( 'display/set the configuration ' )
181+ . description ( 'display/set the configurations ' )
177182 . action ( ( ) => {
178183 handleDisplayConfig ( ) ;
179184 } )
@@ -186,23 +191,26 @@ program.command('config')
186191 }
187192 } ) ;
188193
189- const commandGenerate = program . command ( 'generate' )
190- . description ( 'generate code using CSS Doodle generators' )
194+ const commandGenerate =
195+ program . command ( 'generate' )
196+ . description ( 'generate code using css-doodle generators' )
191197 . action ( ( _ , cmd ) => {
192198 cmd . help ( ) ;
193199 } ) ;
194200
195- commandGenerate . command ( 'svg [source]' )
196- . description ( 'generate SVG code using svg() function' )
197- . action ( ( source ) => {
198- handleGenerateSVG ( source ) ;
199- } )
201+ commandGenerate
202+ . command ( 'svg [source]' )
203+ . description ( 'generate SVG code with svg() function' )
204+ . action ( ( source ) => {
205+ handleGenerateSVG ( source ) ;
206+ } ) ;
200207
201- commandGenerate . command ( 'polygon [source]' )
202- . description ( 'generate CSS polygon() using shape() function' )
203- . action ( source => {
204- handleGenerateShape ( source ) ;
205- } ) ;
208+ commandGenerate
209+ . command ( 'polygon [source]' )
210+ . description ( 'generate CSS polygon() with shape() function' )
211+ . action ( source => {
212+ handleGenerateShape ( source ) ;
213+ } ) ;
206214
207215if ( process . argv . length <= 2 ) {
208216 program . help ( ) ;
0 commit comments