 import Foundation
 
 
-let version = "0.2.0"
+// Application version number.
+let version = "0.2.1"
 
 
+// Command line help text.
 let usage =
     "Usage: hexdump [FLAGS] [OPTIONS] ARGUMENTS\n" +
     "\n" +

            print(".")
        }
    }
    println()
}


main()

}


// Write a single line of output to stdout.
func writeln(data: NSData, offset: Int, bytesPerLine: Int) {

    // I've forgotten why this ugly cast was needed.
    let bytes = UnsafePointer<UInt8>(data.bytes)

    // Write the line number.
    print(String(format: "%6X |", offset))

    for i in 0 ..< bytesPerLine {

        // Write an extra space in front of every fourth byte except the first.
        if i > 0 && i % 4 == 0 {
            print(" ")
        }

        // Write the byte in hex form, or a spacer if we're out of bytes.
        if i < data.length {
            print(String(format: " %02X", bytes[i]))
        } else {
            print("   ")
        }
    }

    print(" | ")

    // Write a character for each byte in the printable ascii range.
    for i in 0 ..< data.length {
        if bytes[i] >= 32 && bytes[i] <= 126 {
            print(String(format: "%c", bytes[i]))
