MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / OptionMode

Function OptionMode

cli.cpp:684–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

682}
683
684bool OptionMode(std::vector<DeviceOptions>* current_devices, std::string argument, Options* options)
685{
686 if(argument.size() == 0)
687 {
688 std::cout << "Error: --mode passed with no argument" << std::endl;
689 return false;
690 }
691
692 /*---------------------------------------------------------*\
693 | If a device is not selected i.e. size() == 0 |
694 | then add mode to allDeviceOptions |
695 \*---------------------------------------------------------*/
696 bool found = false;
697 DeviceOptions* currentDevOpts = &options->allDeviceOptions;
698
699 if(current_devices->size() == 0)
700 {
701 currentDevOpts->mode = argument;
702 currentDevOpts->hasOption = true;
703 found = true;
704 }
705 else
706 {
707 for(size_t i = 0; i < current_devices->size(); i++)
708 {
709 currentDevOpts = &current_devices->at(i);
710
711 currentDevOpts->mode = argument;
712 currentDevOpts->hasOption = true;
713 found = true;
714 }
715 }
716
717 return found;
718}
719
720bool OptionBrightness(std::vector<DeviceOptions>* current_devices, std::string argument, Options* options)
721{

Callers 1

ProcessOptionsFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected