diff --git a/src/commands/General/date.js b/src/commands/General/date.js index c068c4e..3df3655 100644 --- a/src/commands/General/date.js +++ b/src/commands/General/date.js @@ -1,15 +1,21 @@ import dateFormat from "dateformat"; -const date = new Date(); -const d = dateFormat(date, "ddd m-dd-yyyy"); export default class DateCommand { execute(term, params, directory, setDirectory) { + const date = new Date(); + const d = dateFormat(date, "ddd m-dd-yyyy"); term.writeln(''); term.writeln(`Current date is ${d}`); term.writeln(''); } description() { - return "Return current date"; + return "Print current date"; + } + + help(term) { + term.writeln("Usage: date") + term.writeln("This command prints the current date in the format ddd m-dd-yyyy") + term.writeln("Sample output: Thu 01-01-1970") // Current date is Thu 01-01-1970 } } \ No newline at end of file diff --git a/src/commands/General/time.js b/src/commands/General/time.js index a09f3b6..fc9e1c4 100644 --- a/src/commands/General/time.js +++ b/src/commands/General/time.js @@ -16,5 +16,6 @@ export default class TimeCommand { help(term) { term.writeln("Usage: time"); term.writeln("This command prints the current time in the format HH:mm:ss.SSS"); + term.writeln("Sample output: 12:34:30.00") // Current time is 12:34:30:00 } }