2017-02-16 03:27:16 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
/* eslint-disable no-console */
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const getDefaultConfigPath = require('./oputil_common.js').getDefaultConfigPath;
|
|
|
|
|
|
|
|
exports.getHelpFor = getHelpFor;
|
|
|
|
|
|
|
|
const usageHelp = exports.USAGE_HELP = {
|
|
|
|
General :
|
|
|
|
`usage: optutil.js [--version] [--help]
|
|
|
|
<command> [<args>]
|
|
|
|
|
|
|
|
global args:
|
2017-02-25 06:39:31 +00:00
|
|
|
-c, --config PATH : specify config path (${getDefaultConfigPath()})
|
|
|
|
-n, --no-prompt : assume defaults/don't prompt for input where possible
|
2017-02-16 03:27:16 +00:00
|
|
|
|
|
|
|
where <command> is one of:
|
2017-02-25 06:39:31 +00:00
|
|
|
user : user utilities
|
|
|
|
config : config file management
|
|
|
|
fb : file base management
|
2017-02-16 03:27:16 +00:00
|
|
|
|
|
|
|
`,
|
|
|
|
User :
|
|
|
|
`usage: optutil.js user --user USERNAME <args>
|
|
|
|
|
|
|
|
valid args:
|
|
|
|
--user USERNAME : specify username for further actions
|
|
|
|
--password PASS : set new password
|
|
|
|
--delete : delete user
|
|
|
|
--activate : activate user
|
|
|
|
--deactivate : deactivate user
|
|
|
|
`,
|
|
|
|
|
|
|
|
Config :
|
2017-02-20 18:31:24 +00:00
|
|
|
`usage: optutil.js config <action> [<args>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2017-02-20 18:31:24 +00:00
|
|
|
where <action> is one of:
|
2017-02-20 18:46:18 +00:00
|
|
|
new : generate a new/initial configuration
|
|
|
|
import-areas PATH : import areas using fidonet *.NA or AREAS.BBS file from PATH
|
|
|
|
|
|
|
|
valid import-areas <args>:
|
|
|
|
--conf CONF_TAG : specify conference tag in which to import areas
|
|
|
|
--network NETWORK : specify network name/key to associate FTN areas
|
|
|
|
--uplinks UL1,UL2,... : specify one or more comma separated uplinks
|
|
|
|
--type TYPE : specifies area import type. valid options are "bbs" and "na"
|
2017-02-16 03:27:16 +00:00
|
|
|
`,
|
|
|
|
FileBase :
|
2017-02-19 02:00:09 +00:00
|
|
|
`usage: oputil.js fb <action> [<args>] <AREA_TAG|SHA|FILE_ID[@STORAGE_TAG] ...> [<args>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
|
|
|
where <action> is one of:
|
2017-02-20 18:46:18 +00:00
|
|
|
scan AREA_TAG : scan specified areas
|
2017-02-19 02:00:09 +00:00
|
|
|
AREA_TAG may be suffixed with @STORAGE_TAG; for example: retro@bbs
|
|
|
|
|
2017-02-20 18:46:18 +00:00
|
|
|
info AREA_TAG|SHA|FILE_ID : display information about areas and/or files
|
2017-02-19 02:00:09 +00:00
|
|
|
SHA may be a full or partial SHA-256
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2017-02-21 05:31:01 +00:00
|
|
|
move SRC DST : move entry(s) from SRC to DST where:
|
|
|
|
SRC may be FILE_ID|SHA|AREA_TAG
|
|
|
|
DST may be AREA_TAG, optionally suffixed with @STORAGE_TAG; for example: retro@bbs
|
|
|
|
SHA may be a full or partial SHA-256
|
|
|
|
multiple instances of SRC may exist: SRC1 SRC2 ...
|
|
|
|
|
2017-02-16 03:27:16 +00:00
|
|
|
valid scan <args>:
|
2017-02-19 02:00:09 +00:00
|
|
|
--tags TAG1,TAG2,... : specify tag(s) to assign to discovered entries
|
|
|
|
|
|
|
|
valid info <args>:
|
|
|
|
--show-desc : display short description, if any
|
2017-02-16 03:27:16 +00:00
|
|
|
`
|
|
|
|
};
|
|
|
|
|
|
|
|
function getHelpFor(command) {
|
|
|
|
return usageHelp[command];
|
|
|
|
}
|