Skip to content

Instantly share code, notes, and snippets.

@hawkeye64
Created August 27, 2018 18:29
Show Gist options
  • Save hawkeye64/795907c0527fb5a98e9766eea98e4dd9 to your computer and use it in GitHub Desktop.
Save hawkeye64/795907c0527fb5a98e9766eea98e4dd9 to your computer and use it in GitHub Desktop.
command-line-usage Example
const commandLineUsage = require('command-line-usage')
const sections = [
{
header: 'classify',
content: 'Classifies an image using machine learning from passed in image path.'
},
{
header: 'Options',
optionList: [
{
name: 'image',
typeLabel: '{underline imagePath}',
description: '[required] The image path.'
},
{
name: 'confidence',
typeLabel: '{underline value}',
description: '[optional; default 50] The minimum confidence level to use for classification (ex: 50 for 50%).'
},
{
name: 'filter',
typeLabel: '{underline filterFile}',
description: '[optional] A filter file used to filter out classification not wanted.'
},
{
name: 'quick',
description: '[optional; default slow] Use quick classification, but may be more inaccurate.'
},
{
name: 'version',
description: 'Application version.'
},
{
name: 'help',
description: 'Print this usage guide.'
}
]
}
]
const usage = commandLineUsage(sections)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment