Group CLI options into 3 categories to make them more digestible

pull/64/merge
Romain 7 years ago
parent ee1186c1f4
commit 9dcebe6280

@ -59,26 +59,32 @@ Required:
--input Path to the folder with all photos/videos [string] [required]
--output Output path for the static website [string] [required]
Options:
--help Show help [boolean]
--index Filename of the home page [default: "index.html"]
--title Website title [default: "Photo album"]
--footer Text or HTML footer [default: null]
--thumb-size Pixel size of the square thumbnails [number] [default: 120]
--large-size Pixel height of the fullscreen photos [number] [default: 1000]
--original-photos Allow download of full-size photos [boolean] [default: false]
--original-videos Allow download of full-size videos [boolean] [default: false]
--albums-output-folder Output subfolder for HTML albums (default: root of gallery) [default: "."]
Output options:
--thumb-size Pixel size of the square thumbnails [number] [default: 120]
--large-size Pixel height of the fullscreen photos [number] [default: 1000]
--original-photos Copy and allow download of full-size photos [boolean] [default: false]
--original-videos Copy and allow download of full-size videos [boolean] [default: false]
Album options:
--albums-from How to group media into albums [choices: "folders", "date"] [default: "folders"]
--albums-date-format How albums are named in <date> mode [moment.js pattern] [default: "YYYY-MM"]
--sort-albums-by How to sort albums [choices: "title", "start-date", "end-date"] [default: "start-date"]
--sort-albums-direction Album sorting direction [choices: "asc", "desc"] [default: "asc"]
--sort-media-by How to sort photos and videos [choices: "filename", "date"] [default: "date"]
--sort-media-direction Media sorting direction [choices: "asc", "desc"] [default: "asc"]
--theme Name of the gallery theme to apply [choices: "classic", "cards", "mosaic"] [default: "classic"]
--css Path to a CSS/LESS file for styling [string]
--google-analytics Code for Google Analytics tracking [string]
--config Path to JSON config file [string]
Website options:
--index Filename of the home page [default: "index.html"]
--albums-output-folder Output subfolder for HTML albums (default: website root) [default: "."]
--theme Name of the gallery theme to apply [choices: "classic", "cards", "mosaic"] [default: "classic"]
--title Website title [default: "Photo album"]
--footer Text or HTML footer [default: null]
--css Path to a custom provided CSS/LESS file for styling [string]
--google-analytics Code for Google Analytics tracking [string]
Options:
--help Show help [boolean]
--config Path to JSON config file [string]
The optional JSON config should contain a single object with one key per argument, not including the leading "--". For example:

@ -10,8 +10,6 @@ var opts = yargs
' thumbsup [required] [options]\n' +
' thumbsup --config config.json')
.wrap(null)
.group('input', 'Required:')
.group('output', 'Required:')
.help('help')
.options({
@ -20,98 +18,132 @@ var opts = yargs
// ------------------------------------
'input': {
group: 'Required:',
description: 'Path to the folder with all photos/videos',
normalize: true,
demand: true
},
'output': {
group: 'Required:',
description: 'Output path for the static website',
normalize: true,
demand: true
},
// ------------------------------------
// Optional arguments
// Output options
// ------------------------------------
'index': {
description: 'Filename of the home page',
'default': 'index.html'
},
'title': {
description: 'Website title',
'default': 'Photo album'
},
'footer': {
description: 'Text or HTML footer',
'default': null
},
'thumb-size': {
group: 'Output options:',
description: 'Pixel size of the square thumbnails',
type: 'number',
'default': 120
},
'large-size': {
group: 'Output options:',
description: 'Pixel height of the fullscreen photos',
type: 'number',
'default': 1000
},
'original-photos': {
description: 'Allow download of full-size photos',
group: 'Output options:',
description: 'Copy and allow download of full-size photos',
type: 'boolean',
'default': false
},
'original-videos': {
description: 'Allow download of full-size videos',
group: 'Output options:',
description: 'Copy and allow download of full-size videos',
type: 'boolean',
'default': false
},
'albums-output-folder': {
description: 'Output subfolder for HTML albums (default: root of gallery)',
'default': '.'
},
// ------------------------------------
// Album options
// ------------------------------------
'albums-from': {
group: 'Album options:',
description: 'How to group media into albums',
choices: ['folders', 'date'],
'default': 'folders'
},
'albums-date-format': {
group: 'Album options:',
description: 'How albums are named in <date> mode [moment.js pattern]',
'default': 'YYYY-MM'
},
'sort-albums-by': {
group: 'Album options:',
description: 'How to sort albums',
choices: ['title', 'start-date', 'end-date'],
'default': 'start-date'
},
'sort-albums-direction': {
group: 'Album options:',
description: 'Album sorting direction',
choices: ['asc', 'desc'],
'default': 'asc'
},
'sort-media-by': {
group: 'Album options:',
description: 'How to sort photos and videos',
choices: ['filename', 'date'],
'default': 'date'
},
'sort-media-direction': {
group: 'Album options:',
description: 'Media sorting direction',
choices: ['asc', 'desc'],
'default': 'asc'
},
// ------------------------------------
// Website options
// ------------------------------------
'index': {
group: 'Website options:',
description: 'Filename of the home page',
'default': 'index.html'
},
'albums-output-folder': {
group: 'Website options:',
description: 'Output subfolder for HTML albums (default: website root)',
'default': '.'
},
'theme': {
group: 'Website options:',
description: 'Name of the gallery theme to apply',
choices: ['classic', 'cards', 'mosaic'],
'default': 'classic'
},
'title': {
group: 'Website options:',
description: 'Website title',
'default': 'Photo album'
},
'footer': {
group: 'Website options:',
description: 'Text or HTML footer',
'default': null
},
'css': {
description: 'Path to a CSS/LESS file for styling',
group: 'Website options:',
description: 'Path to a custom provided CSS/LESS file for styling',
normalize: true
},
'google-analytics': {
group: 'Website options:',
description: 'Code for Google Analytics tracking',
type: 'string'
},
// ------------------------------------
// Misc options
// ------------------------------------
'config': {
description: 'JSON config file (one key per argument)',
normalize: true

Loading…
Cancel
Save