apache-module-manager icon indicating copy to clipboard operation
apache-module-manager copied to clipboard

Suggestions

Open ricohumme opened this issue 3 years ago • 0 comments

Hi,

Just came across this package and I find it really useful.

A couple of things I would like to suggest here:

  • A quiet parameter so the command is not halting on user input and use the default values (useful for automating with scripts)
  • When using the switch switch with the old and new module doesn't seem to be working as expected. For example:
amm l php
---
ID  NAME        PATH                                                   ENABLED LINE
111 php_module  /opt/homebrew/opt/php/lib/httpd/modules/libphp.so      true    183
110 php7_module /opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp7.so false   182

amm s php_module php7_module
---
? Disable php_module (/opt/homebrew/opt/php/lib/httpd/modules/libphp.so)? Yes
✔ Changed line 183 to #LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so
? Enable php7_module (/opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp7.so)? Yes
✔ Changed line 182 to LoadModule php7_module /opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp7.so
? Restart Apache (brew services restart httpd)? Yes

So far this works as expected. But now, when re-running the same command again (picture this as an alias used multiple times).

amm s php_module php7_module
---
? Disable php7_module (/opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp7.so)? Yes
✔ Changed line 182 to #LoadModule php7_module /opt/homebrew/opt/[email protected]/lib/httpd/modules/libphp7.so
? Enable php_module (/opt/homebrew/opt/php/lib/httpd/modules/libphp.so)? Yes
✔ Changed line 183 to LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so
? Restart Apache (brew services restart httpd)? Yes

Here I would have expected either the output be the same as the first time it was executed, or do nothing because the modules are already in the correct state.

Hope you find this input useful for improving the package. :)

ricohumme avatar Jun 08 '22 12:06 ricohumme