From ded2aa9739cc6c413c050361e5f1518f7e08dd4e Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Tue, 7 Nov 2023 18:48:52 +1000 Subject: [PATCH] added ability to download a file using cat --- clite/commands.js | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/clite/commands.js b/clite/commands.js index 9fd0517..ab256d6 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -77,11 +77,34 @@ Options: clite.commands.load('cat',function(args,env,io) { var files = []; + var download = false; var pending = 0; + function help() { + io.write(` +Usage: cat [OPTION] [FILE] + +Options: +-? Print this help information +-d Download the file data, instead of printing it + `); + } + for (var i=1; i