Helper you configure Apache headers
Requirements
- node, npm
Install
$ sudo npm install -g ahd
$ sudo ahd init
Recommand
아파치를 재시작해야 하기 때문에 sudo로 실행해야 한다. 매번 sudo를 치지 않기 위해서 .bachrc
나 .bash_profile
에 alias를 추가하는 것을 추천한다.
alias ahd="sudo ahd"
$ sudo npm outdated -g ahd # check version
$ sudo npm install -g ahd
$ ahd -h # help
$ ahd -v # version
# Show List
$ ahd list # shortcut 'l'
$ ahd l -e # Show enable header
$ ahd l -d # Show disable header
# Set header
$ ahd -eo wicksome # enable only
$ ahd -e wicksome # enable
$ ahd -d wicksome # disable
$ ahd -d .+@.+ # Interpret pattern as an extended regular expression
$ ahd -ea # enable all
$ ahd -da $ disable all
# Manege header
$ ahd view wicksome # shortcut 'v'
$ ahd add wicksome-test # shortcut 'a'
$ ahd remove wicksome-test # shortcut 'r'
$ ahd edit wicksome # shortcut 'e'
Autocomplete headers using fzf
-
install
$ brew install fzf $ /usr/local/opt/fzf/install
-
set config
.bash_profile
_fzf_complete_ahd() { _fzf_complete "--reverse" "$@" < <( ls ~/.ahd ) }
zsh will automatically pick up the command using the naming convention but in bash you have to connect the function to the command using
complete
command.[ -n "$BASH" ] && complete -F _fzf_complete_ahd -o default -o bashdefault ahd
-
usage
$ ahd -eo **<TAB>