If a parameter begins with a "-" character then it can be
misinterpreted as a shell command parameter. Protect against this
using "--" in various places.
# Base name.
pure function basename (name) returning string = @{
- basename %name
+ basename -- %name
}
# Directory name.
pure function dirname (name) returning string = @{
- dirname %name
+ dirname -- %name
}
# File extension.
# Read a file.
function read (filename) returning string = @{
- cat %filename
+ cat -- %filename
}
# Read a file as a list of lines.
function readlines (filename) returning strings = @{
- cat %filename
+ cat -- %filename
}
# Real path.