 
         
         
-        if CommandLine.arguments[1] == "-s" || CommandLine.arguments[1] == "--set" {
+        if argv[1] == "-s" || argv[1] == "--set" {
             if argc < 3 {
                 print("Specify a display to set its mode. \(help_display_list)")
                 return

func displayInfo(display:CGDirectDisplayID, mode:CGDisplayMode?) -> DisplayInfo? {
    var mode_ = mode
    if mode_ == nil {
        mode_ = CGDisplayCopyDisplayMode(display)!
    }
    
    if let mode__ = mode_ {

    let help_display_list = "List all available displays by:\n    \(binary_name) -l"
    

    if argc > 1 {
        if argv[1] == "-l" || argv[1] == "--list" {
            listDisplays(displayIDs:onlineDisplayIDs, count:displayCount)
            return
        }

        if argv[1] == "-m" || argv[1] == "--mode" {
            if argc < 3 {
                print("Specify a display to see its supported modes. \(help_display_list)")
                return
            }

            if let displayIndex = Int(argv[2]) {
                if displayIndex < displayCount {
                    let _info = listModesByDisplayID(_displayID:onlineDisplayIDs[displayIndex])
                    PrintDisplayModes(_display:onlineDisplayIDs[displayIndex], index:displayIndex, _modes:_info)
                    
                } else {
                    print("Display index: \(displayIndex) not found. \(help_display_list)")
