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]
|
2017-05-24 03:55:22 +00:00
|
|
|
<command> [<args>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
|
|
|
global args:
|
2017-05-23 03:35:06 +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
|
|
|
|
2017-05-23 03:35:06 +00:00
|
|
|
commands:
|
|
|
|
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:
|
2017-05-23 03:35:06 +00:00
|
|
|
--user USERNAME specify username for further actions
|
|
|
|
--password PASS set new password
|
|
|
|
--delete delete user
|
|
|
|
--activate activate user
|
|
|
|
--deactivate deactivate user
|
2017-02-16 03:27:16 +00:00
|
|
|
`,
|
|
|
|
|
|
|
|
Config :
|
2017-02-20 18:31:24 +00:00
|
|
|
`usage: optutil.js config <action> [<args>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2017-05-23 03:35:06 +00:00
|
|
|
actions:
|
|
|
|
new generate a new/initial configuration
|
|
|
|
import-areas PATH import areas using fidonet *.NA or AREAS.BBS file from PATH
|
2017-02-20 18:46:18 +00:00
|
|
|
|
2017-05-23 03:35:06 +00:00
|
|
|
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-09-24 05:03:21 +00:00
|
|
|
`usage: oputil.js fb <action> [<args>]
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2017-05-23 03:35:06 +00:00
|
|
|
actions:
|
2017-05-24 03:55:22 +00:00
|
|
|
scan AREA_TAG[@STORAGE_TAG] scan specified area
|
2017-02-19 02:00:09 +00:00
|
|
|
|
2017-05-23 03:35:06 +00:00
|
|
|
info AREA_TAG|SHA|FILE_ID display information about areas and/or files
|
|
|
|
SHA may be a full or partial SHA-256
|
2017-02-16 03:27:16 +00:00
|
|
|
|
2017-09-24 05:03:21 +00:00
|
|
|
mv SRC [SRC...] DST move entry(s) from SRC to DST
|
|
|
|
SRC: FILENAME_WC|SHA|FILE_ID|AREA_TAG[@STORAGE_TAG]
|
|
|
|
DST: AREA_TAG[@STORAGE_TAG]
|
2017-05-24 03:55:22 +00:00
|
|
|
|
2017-09-24 05:03:21 +00:00
|
|
|
rm SRC [SRC...] remove entry(s) from the system matching SRC
|
|
|
|
SRC: FILENAME_WC|SHA|FILE_ID|AREA_TAG[@STORAGE_TAG]
|
2017-02-21 05:31:01 +00:00
|
|
|
|
2017-05-23 03:35:06 +00:00
|
|
|
scan args:
|
|
|
|
--tags TAG1,TAG2,... specify tag(s) to assign to discovered entries
|
2017-09-24 05:03:21 +00:00
|
|
|
|
2017-08-25 02:22:50 +00:00
|
|
|
--desc-file [PATH] prefer file descriptions from DESCRIPT.ION file over
|
|
|
|
other sources such as FILE_ID.DIZ.
|
|
|
|
if PATH is specified, use DESCRIPT.ION at PATH instead
|
|
|
|
of looking in specific storage locations
|
2017-09-09 05:11:01 +00:00
|
|
|
--update attempt to update information for existing entries
|
2017-02-19 02:00:09 +00:00
|
|
|
|
2017-05-23 03:35:06 +00:00
|
|
|
info args:
|
|
|
|
--show-desc display short description, if any
|
2017-05-24 03:55:22 +00:00
|
|
|
|
|
|
|
remove args:
|
2017-09-24 05:03:21 +00:00
|
|
|
--phys-file also remove underlying physical file
|
2017-05-24 03:55:22 +00:00
|
|
|
`,
|
|
|
|
FileOpsInfo :
|
|
|
|
`
|
|
|
|
general information:
|
|
|
|
AREA_TAG[@STORAGE_TAG] can specify an area tag and optionally, a storage specific tag
|
|
|
|
example: retro@bbs
|
|
|
|
|
|
|
|
FILENAME_WC filename with * and ? wildcard support. may match 0:n entries
|
|
|
|
SHA full or partial SHA-256
|
|
|
|
FILE_ID a file identifier. see file.sqlite3
|
2018-01-01 00:54:11 +00:00
|
|
|
`,
|
|
|
|
MessageBase :
|
|
|
|
`usage: oputil.js mb <action> [<args>]
|
|
|
|
|
|
|
|
actions:
|
|
|
|
areafix CMD1 CMD2 ... ADDR sends an AreaFix NetMail to ADDR with the supplied command(s)
|
|
|
|
one or more commands may be supplied. commands that are multi
|
|
|
|
part such as "%COMPRESS ZIP" should be quoted.
|
2017-02-16 03:27:16 +00:00
|
|
|
`
|
|
|
|
};
|
|
|
|
|
|
|
|
function getHelpFor(command) {
|
|
|
|
return usageHelp[command];
|
|
|
|
}
|