-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command arguments refactoring Pt.1 #66
Merged
leopoldhub
merged 10 commits into
TamtamHero:main
from
leopoldhub:dev-commad-arguments-refactoring
Aug 13, 2024
Merged
Command arguments refactoring Pt.1 #66
leopoldhub
merged 10 commits into
TamtamHero:main
from
leopoldhub:dev-commad-arguments-refactoring
Aug 13, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ket method instead of manual closing, as well as updating error detection pattern
the old argument format is deprecated but still usable. improved feedback when executing commands. TamtamHero#31
leopoldhub
added
documentation
Improvements or additions to documentation
enhancement
New feature or request
labels
Aug 11, 2024
(to be merged after #65) |
…-arguments-refactoring # Conflicts: # README.md # fanctrl.py
leopoldhub
added a commit
that referenced
this pull request
Aug 25, 2024
* Adding @Svenum as an assignee to nix-related issues (#43) * Fixing adding @Svenum as an assignee to nix-related issues (#44) (non contributors cannot be assigned to issues) * Reload will report if config couldn't be parsed and the service keeps running. (#46) Authored-by: Nina Alexandra Klama <[email protected]> * Removing binary blobs from the project (#51) * removing binary blobs from the project. we now fetch the ectool from the gitlab artifacts and confirm the checksum. * remove bin references from README.md * extracting $TEMP_FOLDER from installEctool * Fix README spelling/grammer, fix "FrameWork" capitalization in service description (#52) * Review README spelling/grammar * Fix "FrameWork" capitalization in service * Clarify behaviour on service stop or pause (#53) (#55) * Separating FanController into different subclasses to allow HardwareController and SocketController diversity. 2 (Repost of #50) (#58) * separating `FanController` into different subclasses to allow `HardwareController` and `SocketController` diversity * adding the new arguments into the README.md * fixing an indentation error causing `--strategy <strategy>` not to work (the simple `<strategy>` still worked) * fixing missing print for command execution (#63) * forcing utf-8 encoding for socket messages and usage of stopServerSocket method instead of manual closing, as well as updating error detection pattern (#64) * README.md documentation update (#65) * forcing utf-8 encoding for socket messages and usage of stopServerSocket method instead of manual closing, as well as updating error detection pattern * README.md documentation update * change log format on fatal crash * fix badges links * adding windows platform badge and issue template * fix `:` instead of `=` * disabling part of the README.md while waiting for merge * Command arguments refactoring Pt.1 (#66) * forcing utf-8 encoding for socket messages and usage of stopServerSocket method instead of manual closing, as well as updating error detection pattern * README.md documentation update * change log format on fatal crash * fix badges links * adding windows platform badge and issue template * fix `:` instead of `=` * first part of the command argument refactoring. the old argument format is deprecated but still usable. improved feedback when executing commands. #31 * trim blank lines in README.md * finishing touches (#67) * add no battery mode for mainboards without battery (#69) * add configuration for no battery mode in hardware controller * fix wrong line getting noBatteryMode * dynamically fetching battery sensor on init/reload * add --no-battery flag for install * update readme with --no-battery flag * rework no battery config to come from service args * change sensors to be ectool specific - reword the argument to be more clear about battery sensors - move `noBatteryMode` and `nonBatterySensors` to EctoolHardwareController - update `getNonBatterySensors` to be able to handle more than one sensor - update installer and readme accordingly * update grep command for checking existing `--no-battery-sensors` * combine getTemperature functions to one * add documentation for run option `--no-battery-sensors` * rename variable `NO_BATTERY` to `NO_BATTERY_SENSOR` * update the installer to use existing placeholder format * rename noBatterySensorMode variables and functions for clarity * rename placeholder to `NO_BATTERY_SENSOR_OPTION` for clarity * update comments in installer to reflect new argument name * adding ectool sub-dependency to documentation (#70) * typo "tempurature" => "temperature" (#71) typo "tempurature" => "temperature" * typo "tempurature" => "temperature" (#72) typo "tempurature" => "temperature" * Add ToC + link to NixOS Documentation (#75) * add doc folder * update nix link * add toc * add link * add missin # * add doc * fix link * add new line under titles * add --no-sudo option (#76) * Add choice to print fan speed percentage (#78) * Add option to print current speed percentage * Update README.md * Update commands.md * Add print choice descriptions to help text * add missing no_sudo check (#79) * Add NixOS Flake (#26) * initial * update gitignore * update inputs * add fw-ectool dependencie * add module * fix tabs * fix package * fix typo * fix service * fix type * add options * fix service * fix build inputs * add Readme + add suspend script * remove unneeded }; * fix pkgs.writeShellScript * remvoe \ * try * add self * fix module * update package * fix package * use sleep script * add config options * fix typo * fix typo * add defaults * fix type * add prettyier * remove beautifyer * udpate readme * update installer script * add missing path * Update README.md Co-authored-by: Thomas Eizinger <[email protected]> * Update flake.nix Co-authored-by: Thomas Eizinger <[email protected]> * Update nix/module.nix Co-authored-by: Thomas Eizinger <[email protected]> * add descriptions * fix uninstall * update readme * add description * remove requiremetns.txt + add github actions * update action * rename workflow test * fix service * try * try * Update README.md * Update README.md * chagne flake description * fix suspend script * fix script * fix path * fix install.sh * fix --no-sudo * add --no-sudo to other scripts * fix check * add option check * add missing " * Rename nix action --------- Co-authored-by: Thomas Eizinger <[email protected]> * Update branch to main branch (#54) * Adding @Svenum as an assignee to nix-related issues (#43) * Fixing adding @Svenum as an assignee to nix-related issues (#44) (non contributors cannot be assigned to issues) * Reload will report if config couldn't be parsed and the service keeps running. (#46) Authored-by: Nina Alexandra Klama <[email protected]> * Removing binary blobs from the project (#51) * removing binary blobs from the project. we now fetch the ectool from the gitlab artifacts and confirm the checksum. * remove bin references from README.md * extracting $TEMP_FOLDER from installEctool * Fix README spelling/grammer, fix "FrameWork" capitalization in service description (#52) * Review README spelling/grammar * Fix "FrameWork" capitalization in service * use ectool form nixpkgs * update flake * remove old deps * remove duplicated pkgs --------- Co-authored-by: Léopold Hubert <[email protected]> Co-authored-by: Nina Alexandra Klama <[email protected]> Co-authored-by: DeflateAwning <[email protected]> * Update to main branch + switch to fw-ectool (#61) * Adding @Svenum as an assignee to nix-related issues (#43) * Fixing adding @Svenum as an assignee to nix-related issues (#44) (non contributors cannot be assigned to issues) * Reload will report if config couldn't be parsed and the service keeps running. (#46) Authored-by: Nina Alexandra Klama <[email protected]> * Removing binary blobs from the project (#51) * removing binary blobs from the project. we now fetch the ectool from the gitlab artifacts and confirm the checksum. * remove bin references from README.md * extracting $TEMP_FOLDER from installEctool * Fix README spelling/grammer, fix "FrameWork" capitalization in service description (#52) * Review README spelling/grammar * Fix "FrameWork" capitalization in service * Clarify behaviour on service stop or pause (#53) (#55) * Separating FanController into different subclasses to allow HardwareController and SocketController diversity. 2 (Repost of #50) (#58) * separating `FanController` into different subclasses to allow `HardwareController` and `SocketController` diversity * adding the new arguments into the README.md * fixing an indentation error causing `--strategy <strategy>` not to work (the simple `<strategy>` still worked) * add fw-ectool in module * fixing missing print for command execution (#63) --------- Co-authored-by: Léopold Hubert <[email protected]> Co-authored-by: Nina Alexandra Klama <[email protected]> Co-authored-by: DeflateAwning <[email protected]> * add doc + .gitignore * Add NixOS Flake (#26) * initial * update gitignore * update inputs * add fw-ectool dependencie * add module * fix tabs * fix package * fix typo * fix service * fix type * add options * fix service * fix build inputs * add Readme + add suspend script * remove unneeded }; * fix pkgs.writeShellScript * remvoe \ * try * add self * fix module * update package * fix package * use sleep script * add config options * fix typo * fix typo * add defaults * fix type * add prettyier * remove beautifyer * udpate readme * update installer script * add missing path * Update README.md Co-authored-by: Thomas Eizinger <[email protected]> * Update flake.nix Co-authored-by: Thomas Eizinger <[email protected]> * Update nix/module.nix Co-authored-by: Thomas Eizinger <[email protected]> * add descriptions * fix uninstall * update readme * add description * remove requiremetns.txt + add github actions * update action * rename workflow test * fix service * try * try * Update README.md * Update README.md * chagne flake description * fix suspend script * fix script * fix path * fix install.sh * fix --no-sudo * add --no-sudo to other scripts * fix check * add option check * add missing " * Rename nix action --------- Co-authored-by: Thomas Eizinger <[email protected]> * Update branch to main branch (#54) * Adding @Svenum as an assignee to nix-related issues (#43) * Fixing adding @Svenum as an assignee to nix-related issues (#44) (non contributors cannot be assigned to issues) * Reload will report if config couldn't be parsed and the service keeps running. (#46) Authored-by: Nina Alexandra Klama <[email protected]> * Removing binary blobs from the project (#51) * removing binary blobs from the project. we now fetch the ectool from the gitlab artifacts and confirm the checksum. * remove bin references from README.md * extracting $TEMP_FOLDER from installEctool * Fix README spelling/grammer, fix "FrameWork" capitalization in service description (#52) * Review README spelling/grammar * Fix "FrameWork" capitalization in service * use ectool form nixpkgs * update flake * remove old deps * remove duplicated pkgs --------- Co-authored-by: Léopold Hubert <[email protected]> Co-authored-by: Nina Alexandra Klama <[email protected]> Co-authored-by: DeflateAwning <[email protected]> * Update to main branch + switch to fw-ectool (#61) * Adding @Svenum as an assignee to nix-related issues (#43) * Fixing adding @Svenum as an assignee to nix-related issues (#44) (non contributors cannot be assigned to issues) * Reload will report if config couldn't be parsed and the service keeps running. (#46) Authored-by: Nina Alexandra Klama <[email protected]> * Removing binary blobs from the project (#51) * removing binary blobs from the project. we now fetch the ectool from the gitlab artifacts and confirm the checksum. * remove bin references from README.md * extracting $TEMP_FOLDER from installEctool * Fix README spelling/grammer, fix "FrameWork" capitalization in service description (#52) * Review README spelling/grammar * Fix "FrameWork" capitalization in service * Clarify behaviour on service stop or pause (#53) (#55) * Separating FanController into different subclasses to allow HardwareController and SocketController diversity. 2 (Repost of #50) (#58) * separating `FanController` into different subclasses to allow `HardwareController` and `SocketController` diversity * adding the new arguments into the README.md * fixing an indentation error causing `--strategy <strategy>` not to work (the simple `<strategy>` still worked) * add fw-ectool in module * fixing missing print for command execution (#63) --------- Co-authored-by: Léopold Hubert <[email protected]> Co-authored-by: Nina Alexandra Klama <[email protected]> Co-authored-by: DeflateAwning <[email protected]> --------- Co-authored-by: Léopold Hubert <[email protected]> Co-authored-by: Nina Alexandra Klama <[email protected]> Co-authored-by: DeflateAwning <[email protected]> Co-authored-by: Oli Thornton <[email protected]> Co-authored-by: Ryan <[email protected]> Co-authored-by: Thomas Eizinger <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is related to #31 .
Hi, the goal here is to refactor arguments into commands and subcommands.
Until now, there has been no restriction on the arguments used when running a command.
(we could literally use
fw-fanctrl deaf --run --config "..." --no-log --query --list-strategies --reload --pause --resume [...]
as a valid command, which makes absolutely no sense)And as a result, we were forced to filter some of them without giving any feedback to the user (eg. if the
--run
was present, only--sc
,--hc
,--config
and<strategy>
were used).To mitigate this, I have separated these arguments into commands and subcommands, making it impossible to use incompatible arguments at the same time.
To avoid breaking existing systems, I still kept the original argument parser, and print a warning message to the user about its deprecation.
Here are the new commands:
the base of all commands is the following
First, the global options
run
run the service manually
If you have installed it correctly, the systemd
fw-fanctrl.service
service will do this for you, so you probably willnever need those.
use
change the current strategy
reset
reset to the default strategy
reload
reload the configuration file
pause
pause the service
resume
resume the service
print
print the selected information