RosettaCodeData/Task/Take-notes-on-the-command-line/Sidef/take-notes-on-the-command-line.sidef

11 lines
202 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
var file = %f'notes.txt'
if (ARGV.len > 0) {
var fh = file.open_a
fh.say(Time.local.ctime + "\n\t" + ARGV.join(" "))
fh.close
} else {
var fh = file.open_r
fh && fh.each { .say }
}