Category : command-line-interface

Using CLIUtils/CLI11 when i call a transform mutating validator followed by a call to the check validator, check never gets called. If a non mutating transform is called before check, everything is fine and check is called. for example the bad case: grp->add_option_function<std::string>( "–file_path", [&](std::string_view str) { //do something here }, "File Path") ->transform(MutatingValidator()) ->check(NonMutatingValidator()); ..

Read more

I’m new to writing code and I don’t understand many things, what could be a mistake? I’m trying to write a function in order to convert an image into bytes static BYTE ImageToByte2(System::Drawing::Image img) { BYTE result; System::Byte result; System::IO::MemoryStream memoryStream = new System::IO::MemoryStream(); { img.Save(memoryStream, System::Drawing::Imaging::ImageFormat.Png); result = memoryStream.ToArray(); } return result; } Error: ..

Read more

I implemented my own way of printing colored texts in cross-platform. However, I used macros. Is this a bad practice or something that should be avoided? If so, what alternative methods would you recommend? Code: #ifndef CLIOUTPUT_H_ #include <stdio.h> #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) #include <Windows.h> #define _RED 0x0C #define _GREEN 0x0A ..

Read more

Hi I am getting strange key board behavior when I try to connect to an FTP server using Windows 10 on the command line… >sftp [email protected] The authenticity of host ‘something.something.com (12.345.67.89)’ can’t be established. ECDSA key fingerprint is xxxxx:dkjhroihoiohgnb9q94904oeie844598576984deoh. Are you sure you want to continue connecting (yes/no/[fingerprint])? At this point I cannot type ..

Read more

Hey so I am trying to automate to enable/disable devices across multiple systems. Devices fall under the same name but will have different Instance Ids and I was trying to pull that and disable them using Ids. #Example: $env:MicrosoftBasicDisplayAdapterid = Get-PnpDevice -FriendlyName ‘*Microsoft Basic Display Adapter*’ | Select-Object -Property InstanceId | $env:MicrosoftBasicDisplayAdapterid #output @{InstanceId=PCIVEN_7845&DEV_9A60&SUBSYS_4561086&REV_00&789456&0&10} My ..

Read more