0
/**
* Displays the list of autolab commands along with their functions.
* @module lib/help
*/
var Table = require('cli-table');
var chalk = require('chalk');
var helpjson = {
'init' : 'Initializes local repository and authenticates',
'exit' : 'Wipes off the credentials from the system',
'git create' : 'Creates a repository on Gitlab',
'git delete' : 'Deletes the specified repository from Gitlab',
'git changeserver' : 'To change the host of Gitlab',
'git changelang' : 'To change the language of the code submission',
'git push' : 'Adds, commits, pushes the code',
'submit' : 'To submit the code to JavaAutolab and fetch the results',
'help' : 'Print help manual'
};
module.exports = function() {
/**
* Displays the list of autolab commands along with their functions.
* @function
* @param {null}
*/
console.log('\n' + chalk.blue('Usage:') + ' autolab [OPTIONS]');
var table = new Table({
head: ['Options:', ''],
colWidths: [20,70]
});
for (var key in helpjson)
table.push(
[key,helpjson[key]]
);
console.log(table.toString());
};
我試過這個,但html頁面只顯示lib/help,然後是空白頁。我也想用@exports來說明模塊導出的內容。還有一種方法可以記錄JSDoc中對象的用途和概述。如何使用jsdoc記錄模塊中的函數?