* * @param cliOptions
(cliOptions)
| 262 | * @param cliOptions |
| 263 | */ |
| 264 | function printSavedCommand (cliOptions) { |
| 265 | const cachePath = getCacheDirectory (); |
| 266 | const historyPath = path.join (cachePath, 'history'); |
| 267 | const historyFile = path.join (historyPath, 'commands.json'); |
| 268 | const list = JSON.parse (fs.readFileSync (historyFile).toString ()) || []; |
| 269 | const listWithIds = []; |
| 270 | for (let i = 0; i < list.length; i++) { |
| 271 | listWithIds.push ({ 'index': i + 1, 'command': list[i] }); |
| 272 | } |
| 273 | printHumanReadable ('', listWithIds, cliOptions, true); |
| 274 | } |
| 275 | |
| 276 | //----------------------------------------------------------------------------- |
| 277 |
no test coverage detected
searching dependent graphs…