From d2d3bfacfe6f1a81665eaa462d06ae6f093030f3 Mon Sep 17 00:00:00 2001 From: Ilia Isupov Date: Thu, 23 Mar 2017 11:36:35 +0900 Subject: [PATCH] Added help informaton about config overriding --- bin/docpub.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/bin/docpub.js b/bin/docpub.js index e3fbf71..749e950 100755 --- a/bin/docpub.js +++ b/bin/docpub.js @@ -18,6 +18,25 @@ program .option('--config-path ', 'path for the config') .option('-v --verbose', 'verbose output'); +program.on('--help', () => { + console.log(' Overriding config'); + console.log(' To override any config option use full option path converted to --kebab-case'); + console.log(''); + + console.log(' Examples:'); + console.log(' docpub --username user@example.com'); + console.log(' docpub --token abcdefghijklmn12345'); + console.log(''); + console.log(' You can also use environment variables converted to snake_case with'); + console.log(' docpub_ prefix'); + console.log(''); + console.log(' Examples:'); + console.log(' docpub_url=my-awesome-docs.zendesk.com docpub'); + console.log(' docpub_token=abcdefghijklmn12345 docpub'); + console.log(''); + console.log(' If both cli flag and env var are used, cli flag takes precedence') ; +}); + program.parse(process.argv); const docpub = new Docpub(program);