Coder Social home page Coder Social logo

Comments (2)

akenion avatar akenion commented on August 18, 2024

Auto-complete is implemented specifically for bash at present (though the Python script that backs it is portable).

This can be used directly in zsh as well by running the following before sourcing the bash completion file:

autoload -Uz +X compinit && compinit
autoload -Uz +X bashcompinit && bashcompinit

from wordfence-cli.

davidnuzik avatar davidnuzik commented on August 18, 2024

v2.1.0-rc2 11/27/23

SUMMARY:
QA validation PASSED. Auto-completion works for me after testing on a couple of different environments. I tested primarily with bash and briefly with zsh. Either seems to work as expected.

VALIDATION STEPS

  1. Source the scripts/complete.bash file (such as by cloning the project or just by downloading this file).
  2. Ensure that auto-complete works as expected for all the subcommands and args - I spot checked many of them but not every single one. When I would partially type a subcommand and then a - for an arg and then <TAB><TAB> to list all, then all args were printed from what I can tell, so everything should be good to go.
  3. Test with each bash and zsh, note the extra steps for zsh Alex mentioned in this issue.

NOTES:
Example of ` autocomplete results for each subcommand

david@ubuntu2204:~$ source wordfence-cli/scripts/complete.bash 
david@ubuntu2204:~$ wordfence vuln-scan -
--accept-terms              -E                          -l                          --no-debug                  --output                    --quiet                     --smtp-user
--banner                    --email                     -L                          --no-help                   --output-columns            --read-stdin                -t
-c                          --email-from                --license                   --no-informational          --output-format             --relative-content-path     --theme-directory
-C                          --exclude-vulnerability     --log-level                 --no-output                 --output-headers            --relative-mu-plugins-path  -v
--cache                     -f                          -m                          --no-output-headers         --output-path               --relative-plugins-path     --verbose
--cache-directory           --feed                      -M                          --no-prefix-log-levels      -p                          --require-path              --version
--check-for-update          -h                          --no-accept-terms           --no-purge-cache            -P                          -s                          -w
--color                     --help                      --no-banner                 --no-quiet                  --path-separator            --sendmail-path             --wfi-url
--configuration             -i                          --noc1-url                  --no-read-stdin             --plugin-directory          --smtp-host                 --wordpress-path
-d                          -I                          --no-cache                  --no-require-path           --prefix-log-levels         --smtp-password             
--debug                     --include-vulnerability     --no-check-for-update       --no-verbose                --purge-cache               --smtp-port                 
-e                          --informational             --no-color                  --no-version                -q                          --smtp-tls-mode             
david@ubuntu2204:~$ wordfence malware-scan -
-a                       --debug                  --images                 -n                       --no-include-all-files   --output-columns         -s                       --wfi-url
--accept-terms           -e                       --include-all-files      -N                       --no-match-all           --output-format          --scanned-content-limit  --workers
--allow-io-errors        -E                       --include-files          --no-accept-terms        --no-output              --output-headers         --sendmail-path          -x
--banner                 --email                  --include-files-pattern  --no-allow-io-errors     --no-output-headers      --output-path            --smtp-host              -X
-c                       --email-from             --include-signatures     --no-banner              --no-prefix-log-levels   --pcre-backtrack-limit   --smtp-password          -z
--cache                  --exclude-files          -l                       --noc1-url               --no-progress            --pcre-recursion-limit   --smtp-port              
--cache-directory        --exclude-files-pattern  -L                       --no-cache               --no-purge-cache         --prefix-log-levels      --smtp-tls-mode          
--check-for-update       --exclude-signatures     --license                --no-check-for-update    --no-quiet               --progress               --smtp-user              
--chunk-size             --file-list-separator    --log-level              --no-color               --no-read-stdin          --purge-cache            -v                       
--color                  -h                       -m                       --no-debug               --no-verbose             -q                       --verbose                
--configuration          --help                   -M                       --no-help                --no-version             --quiet                  --version                
-d                       -i                       --match-all              --no-images              --output                 --read-stdin             -w                       
david@ubuntu2204:~$ wordfence configure -
--accept-terms          -d                      --help                  --no-cache              --no-purge-cache        --purge-cache           --smtp-port             --workers
--banner                -D                      -l                      --no-check-for-update   --no-quiet              -q                      --smtp-tls-mode         
-c                      --debug                 -L                      --no-color              --no-request-license    --quiet                 --smtp-user             
--cache                 --default               --license               --no-debug              --no-verbose            -r                      -v                      
--cache-directory       -E                      --log-level             --no-default            --no-version            --request-license       --verbose               
--check-for-update      --email                 --no-accept-terms       --no-help               -o                      --sendmail-path         --version               
--color                 --email-from            --no-banner             --no-overwrite          --overwrite             --smtp-host             -w                      
--configuration         -h                      --noc1-url              --no-prefix-log-levels  --prefix-log-levels     --smtp-password         --wfi-url               
david@ubuntu2204:~$ wordfence terms -
--accept-terms          --color                 --email-from            --log-level             --no-color              --no-verbose            --sendmail-path         -v
--banner                --configuration         -h                      --no-accept-terms       --no-debug              --no-version            --smtp-host             --verbose
-c                      -d                      --help                  --no-banner             --no-help               --prefix-log-levels     --smtp-password         --version
--cache                 --debug                 -l                      --noc1-url              --no-prefix-log-levels  --purge-cache           --smtp-port             --wfi-url
--cache-directory       -E                      -L                      --no-cache              --no-purge-cache        -q                      --smtp-tls-mode         
--check-for-update      --email                 --license               --no-check-for-update   --no-quiet              --quiet                 --smtp-user             
david@ubuntu2204:~$ wordfence help -
--accept-terms          --color                 --email-from            --log-level             --no-color              --no-verbose            --sendmail-path         -v
--banner                --configuration         -h                      --no-accept-terms       --no-debug              --no-version            --smtp-host             --verbose
-c                      -d                      --help                  --no-banner             --no-help               --prefix-log-levels     --smtp-password         --version
--cache                 --debug                 -l                      --noc1-url              --no-prefix-log-levels  --purge-cache           --smtp-port             --wfi-url
--cache-directory       -E                      -L                      --no-cache              --no-purge-cache        -q                      --smtp-tls-mode         
--check-for-update      --email                 --license               --no-check-for-update   --no-quiet              --quiet                 --smtp-user             
david@ubuntu2204:~$ wordfence version -
--accept-terms          --color                 --email-from            --log-level             --no-color              --no-verbose            --sendmail-path         -v
--banner                --configuration         -h                      --no-accept-terms       --no-debug              --no-version            --smtp-host             --verbose
-c                      -d                      --help                  --no-banner             --no-help               --prefix-log-levels     --smtp-password         --version
--cache                 --debug                 -l                      --noc1-url              --no-prefix-log-levels  --purge-cache           --smtp-port             --wfi-url
--cache-directory       -E                      -L                      --no-cache              --no-purge-cache        -q                      --smtp-tls-mode         
--check-for-update      --email                 --license               --no-check-for-update   --no-quiet              --quiet                 --smtp-user  

Tested primarily on amd64 Ubuntu 22.04.3 with GNU bash 5.1.16, and zsh 5.8.1 -- both were provided by default ubuntu repos.

from wordfence-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.