feat: ability to add banner (#20)

Lets you add a custom banner.

```sh
create-index src -u --banner "/* eslint-disable */"
```
```js
/* eslint-disable */

// @create-index

import xxx ...
```
This commit is contained in:
laggingreflex
2016-11-29 17:45:23 +00:00
committed by Gajus Kuizinas
parent d7e2528999
commit fdb17d0179
4 changed files with 26 additions and 4 deletions
+8 -1
View File
@@ -15,10 +15,17 @@ const argv = yargs
type: 'boolean'
}
})
.options({
'banner': {
description: 'Add a custom banner at the top of the index file',
type: 'string'
}
})
.example('create-index ./src ./src/utilities', 'Creates or updates an existing create-index index file in the target (./src, ./src/utilities) directories.')
.example('create-index --update ./src ./tests', 'Finds all create-index index files in the target directories and descending directories. Updates found index files.')
.argv;
writeIndexCli(argv._, {
updateIndex: argv.update
updateIndex: argv.update,
banner: argv.banner
});