owasp-noir / noir

Attack surface detector that identifies endpoints by static analysis
https://owasp.org/www-project-noir/
MIT License
557 stars 41 forks source link

Add Noir shell completion to Homebrew core #415

Open hahwul opened 3 days ago

hahwul commented 3 days ago

e.g

def install
  # .....
  bash_completion.install 'completions/zsh/_noir'
  zsh_completion.install 'completions/bash/noir'
end

or

generate_completions_from_executable(bin/"foo", "completions", shell_parameter_format: "--selected-shell=",
                                     shells: [:bash])

# translates to
(bash_completion/"foo").write [Utils](https://rubydoc.brew.sh/Utils.html).[safe_popen_read](https://rubydoc.brew.sh/Utils.html#safe_popen_read-class_method)({ "SHELL" => "bash" }, bin/"foo",
                                                    "completions", "--selected-shell=bash")
hahwul commented 3 days ago

Cli

# zsh
noir --generate-completion zsh

# bash
noir --generate-completion bash
hahwul commented 3 days ago

After the release of v0.18.0, the following code should be applied to the Homebrew core. Although there is already a shell completion feature, due to the potential for bug(fixed #416) in the current version, this will be implemented after version 0.18.0.

generate_completions_from_executable(bin/"noir", shell_parameter_format: "--generate-completion=",
                                     shells: [:bash, :zsh, :fish])