@@ -3,8 +3,12 @@ import massarg from "massarg"
33import chalk from "chalk"
44import { LogLevel , ScaffoldCmdConfig } from "./types"
55import { Scaffold } from "./scaffold"
6+ import path from "path"
7+ import fs from "fs/promises"
8+
9+ export async function parseCliArgs ( args = process . argv . slice ( 2 ) ) {
10+ const pkg = JSON . parse ( ( await fs . readFile ( path . join ( __dirname , "package.json" ) ) ) . toString ( ) )
611
7- export function parseCliArgs ( args = process . argv . slice ( 2 ) ) {
812 return (
913 massarg < ScaffoldCmdConfig & { help : boolean ; extras : string [ ] } > ( )
1014 . main ( Scaffold )
@@ -88,9 +92,12 @@ export function parseCliArgs(args = process.argv.slice(2)) {
8892 binName : "simple-scaffold" ,
8993 useGlobalColumns : true ,
9094 usageExample : "[options]" ,
91- header : " Create structured files based on templates." ,
95+ header : [ ` Create structured files based on templates.` ] . join ( "\n" ) ,
9296 footer : [
93- `Copyright © Chen Asraf 2021` ,
97+ `Version: ${ pkg . version } ` ,
98+ `Copyright © Chen Asraf 2017-${ new Date ( ) . getFullYear ( ) } ` ,
99+ `` ,
100+ `Documentation: ${ chalk . underline `https://casraf.blog/simple-scaffold` } ` ,
94101 `NPM: ${ chalk . underline `https://npmjs.com/package/simple-scaffold` } ` ,
95102 `GitHub: ${ chalk . underline `https://github.com/chenasraf/simple-scaffold` } ` ,
96103 ] . join ( "\n" ) ,
0 commit comments