Take notes on the command line is part of Short Circuit's Console Program Basics selection.
Invoking NOTES without commandline arguments displays the current contents of the local NOTES.TXT if it exists.
If NOTES has arguments, the current date and time are appended to the local NOTES.TXT followed by a newline.
Then all the arguments, joined with spaces, prepended with a tab, and appended with a trailing newline, are written to NOTES.TXT.
If NOTES.TXT doesn't already exist in the current directory then a new NOTES.TXT file should be created.

program notes;
 
{$APPTYPE CONSOLE}
 
uses
  Classes,
  SysUtils,
  IOUtils;
 
const
  FILENAME = 'NOTES.TXT';
  TAB = #9;
 
var
  sw: TStreamWriter;
  i : integer;
 
begin
  if ParamCount = 0 then
  begin
    if TFile.Exists(FILENAME) then
      write(TFile.ReadAllText(FILENAME));
  end
  else
  begin
    if TFile.Exists(FILENAME) then
      sw := TFile.AppendText(FILENAME)
    else
      sw := TFile.CreateText(FILENAME);
 
    sw.Write(FormatDateTime('yyyy-mm-dd hh:nn',Now));
    sw.Write(TAB);
    for i := 1 to ParamCount do
    begin
      sw.Write(ParamStr(i));
      if i < ParamCount then
        sw.Write(' ');
    end;
    sw.WriteLine;
    sw.Free;
  end;
end.