Commit Graph

78 Commits

Author SHA1 Message Date
k1-801
8b8451017e Non-important warnings removed
Commit amended by Adam Honse <calcprogrammer1@gmail.com> due to merging from a different branch.
2020-09-01 23:29:00 -05:00
Adam Honse
634ec9f488 Wait on asynchronous device detection before performing CLI operations that require device list 2020-08-07 23:01:20 -05:00
Adam Honse
8667211180 Move console attachment to main and only perform if running in a terminal. (!102) 2020-08-05 21:49:20 -05:00
Adam Honse
dee23ec52e Use synchronous mode update function in CLI 2020-07-22 23:29:32 -05:00
Adam Honse
25f9e2a110 Add --client command line argument for opening network clients 2020-07-05 04:25:46 -05:00
Adam Honse
dfb2e52e7b Add --i2c-tools to help text with warning, set GUI flag if --i2c-tools is specified 2020-06-28 21:41:00 -05:00
Adam Honse
7d2877a8e9 Don't exit after loading a profile from the command line 2020-06-28 11:21:56 -05:00
Adam Honse
15ace9d094 Add flag to start application minimized to tray 2020-06-28 02:30:23 -05:00
Adam Honse
58aba0a147 Allow specifying --gui and --server together 2020-06-28 02:18:28 -05:00
Térence Clastres
b79ff124e6 Replace Sleep() by std::thread::sleep_for() 2020-06-24 09:28:11 -05:00
Adam Honse
60baf6d05f Remove duplicate line 2020-06-24 08:26:09 -05:00
Swyter
cb9b22804a Implement human color parsing in the command-line by using the standardized CSS 3 subset, well known for styling. Interpret first as text to avoid problems like 'darkgreen' being picked up as 0xDA.
- Also, and make case insensitive by using the strcasecmp() function. Both for colors and modes. The only improvement I can think of is stripping whitespace beforehand.
  - Also, improve digit parsing by using `strtoul()`, previously only FF00FF worked, whereas now we can type things like 0xFF00ff or 0xff00ff.

For example; something like this should work: `OpenRGB.exe -c darkgreen,ff00ff,0xff0000,red,REd,teal,pink,gOLd,AAgoldo,magenta -m breathing`

(`AAgoldo` will throw a `Error: Unknown color: 'AAgoldo', skipping.`; and pick the next color instead, this is intended behavior)
2020-06-23 23:15:10 -05:00
Térence Clastres
d2dfd03551 Use the default SDK port constant in the CLI 2020-06-23 23:10:41 -05:00
Térence Clastres
f3bdee9bd2 CLI: Allow --mode flag to be case insensitive
Also fix handling when no argument passed
2020-06-23 23:10:29 -05:00
Térence Clastres
0286a5dd58 CLI: Add daemon/server mode 2020-06-20 14:39:01 -05:00
Térence Clastres
b3cadbae5d Fix CLI
It was not changing the colors since e3e6c034 and had an overflow on
`options->devices.size()` since 0f4ddd16 causing options not to be applied

Second issue was a bit trickier as it was not reproducable when using a
debug build. It seemed like `std::vector<DeviceOptions> devices` had an
overflow. I saw a bunch of warnings regarding comparison with implicit
cast so I figured I'd fix that first and see if it makes a difference.
Turns out it did and fixed the issue.

While toying around, I also noticed that `throw` didn't seem to work,
causing crashes later in the program. It turns out the catch-all clause
`catch (...)` is not necessary matching a `throw NULL` expression as it
might be of type `int`. The solution is to use `thrown nullptr;`
instead.

Reference: https://en.cppreference.com/w/cpp/language/try_catch
2020-06-19 16:46:57 -05:00
Adam Honse
eaa3b9a368 Add command line option to enable i2c tools 2020-05-12 11:01:46 -05:00
Adam Honse
aa1ad8db85 Add zone resizing to CLI 2020-04-04 02:53:55 -05:00
Adam Honse
fdbaf9bf63 Fix segfault in CLI 2020-03-22 22:18:30 -05:00
Adam Honse
08a1197b7e Fix arguments not parsing in CLI, add mode specific color support to CLI 2020-03-22 16:22:59 -05:00
Adam Honse
87a9ea5b14 Add some comments to the CLI code and clean up some warnings 2020-03-22 03:49:08 -05:00
Adam Honse
2b8d25559a Move help and version functions to the same place as the other arguments 2020-03-22 01:48:57 -05:00
Adam Honse
3db9189cbb Fix current device ID in CLI 2020-03-22 01:01:01 -05:00
Adam Honse
a0c379e8c7 Add profile saving to command line 2020-03-22 00:26:06 -05:00
Adam Honse
0ae4964545 Clean up some of the CLI code and add option to load a profile from the command line 2020-03-22 00:04:27 -05:00
Adam Honse
69651b3f91 Load sizes for variable-size controllers in CLI mode 2020-03-20 13:50:54 -05:00
Adam Honse
c7960c090a Add software version information to CLI 2020-02-29 14:01:06 -06:00
Stefan Reiter
71c650cd45 Add cli.cpp and make it build at least
Not confirmed working as of yet, but at least it builds and
--list-devices works.

Code originally taken from Sam Lewis (@sam-masaki on gitlab.com), see:
https://gitlab.com/CalcProgrammer1/OpenRGB/-/merge_requests/9
2020-02-24 00:03:07 -06:00