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.

constant cmd = command_line()
constant filename = "notes.txt"
integer fn
object line
sequence date_time
 
if length(cmd) < 3 then
    fn = open(filename,"r")
    if fn != -1 then
        while 1 do
            line = gets(fn)
            if atom(line) then
                exit
            end if
            puts(1,line)
        end while
        close(fn)
    end if
else
    fn = open(filename,"a") -- if such file doesn't exist it will be created
    date_time = date()
    date_time = date_time[1..6]
    date_time[1] += 1900
    printf(fn,"%d-%02d-%02d %d:%02d:%02d\n",date_time)
    line = "\t"
    for n = 3 to length(cmd) do
        line &= cmd[n] & ' '
    end for
    line[$] = '\n'
    puts(fn,line)
    close(fn)
end if