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.

'Note that the 1st item in 'Args' is the file name as on the command line './CLIOnly.gambas'
 
Public Sub Main()
Dim sContents As String                                                     'To store the file contents
Dim sArgs As String[] = Args.All                                            'To store all the Command line Arguments
 
If Not Exist(User.home &/ "NOTES.TXT") Then                                 'If NOTES.TXT doesn't already exist in the current directory then..
  File.Save(User.home &/ "NOTES.TXT", "")                                   'a new NOTES.TXT file should be created.
  Print "New file 'NOTES.TXT' created."                                     'A meassge
Endif
 
sContents = File.Load(User.home &/ "NOTES.TXT")                             'Get the contents of the file
 
If Args.count < 2 Then                                                      'If NOTES has arguments (other than the file name)
  Print sContents                                                           'Print the file contents
Else
  sContents &= Format(Now, "dddd dd mmmm, yyyy, hh:nn:ss") & gb.NewLine &   'The current date and time are appended to the local NOTES.TXT followed by a newline and..
     gb.Tab & sArgs.Join(" ") & gb.NewLine                                  'Then all the arguments, joined with spaces, prepended with a tab, and appended with a trailing newline
  Print sContents                                                           'Displays the current contents of the local NOTES.TXT
  File.Save(User.home &/ "NOTES.TXT", sContents)                            'Write contents to NOTES.TXT
Endif
 
End