     var displayIndex = 0, width = 0
     var height, scale:Int?
     init(_ arr:[String]) {
-        var args = arr.compactMap({ Int($0) })
+        var args = arr.compactMap { Int($0) }
         
         if args.count < 1 { return }
         

   -r 800      shorthand for -s 0 800 2
   -d          toggle macOS Dark Mode
   -sl         sleep display
"""

func main () {
    let screens = Screens()
    let darkMode = DarkMode()

    let input = UserInput(CommandLine.arguments)
    
    // dipatch functions
    switch input.intention {
    case .listDisplays:
        screens.listDisplays()
        
    case let .listModes(displayIndex):
        guard displayIndex < screens.displayCount else {
            print("Display index( \(displayIndex) ) not found. \(help_display_list)")
            return
        }
        
        print("Supported Modes for Display \(displayIndex):")
        screens.listModes(displayIndex)

    case .setMode:
        screens.set(with:DisplayUserSetting( input.arguments ))
    case .darkMode:
        darkMode.toggle()
    case .sleepDisplay:
        sleepDisplay()
    default:
        print(help_msg)
    }
}


    }
}

func sleepDisplay() {
    let r = IORegistryEntryFromPath(kIOMasterPortDefault, strdup("IOService:/IOResources/IODisplayWrangler"))

