thinkbeforecoding / Fargo

A functional command line argument parser with builtin completion.
38 stars 7 forks source link

Cross-platform support. #1

Closed sheridanchris closed 1 year ago

sheridanchris commented 1 year ago

These imports break Fargo on non-windows machines.

[<DllImport("kernel32.dll", SetLastError=true)>]
extern bool GetConsoleMode(IntPtr hConsoleHandle , uint32& lpMode) 
[<DllImport("kernel32.dll", SetLastError=true)>]
extern IntPtr GetStdHandle(int nStdHandle)
[<DllImport("kernel32.dll", SetLastError=true)>]
extern bool SetConsoleMode(IntPtr hConsoleHandle, uint32 dwMode )
thinkbeforecoding commented 1 year ago

Right, I can probably skip it enterly on other platforms

sheridanchris commented 1 year ago

I'd like to PR this. Should supportVT100 return true or false on Linux and MacOS. I'm thinking true as most modern terminal emulators support ANSI color codes.

thinkbeforecoding commented 1 year ago

😊 Thank you! I should probably return true. This way it would use vt100 codes for display