nginxConfigFormatterGo是一款nginx配置文件格式化工具,作者使用go語言開發(fā),通過nginxConfigFormatterGo可以根據(jù)不同的系統(tǒng)進行打包二進制文件在服務(wù)器上使用,執(zhí)行效率更高。
軟件特色
可預(yù)測的格式化結(jié)果.
所有的注釋都獨立一行.
連續(xù)的多個空行合并為一個空行.
花括號使用Java的習(xí)慣.
所有的行使用統(tǒng)一的方式進行縮進, 縮進的空格數(shù)由用戶指定 (默認 4 個空格).
多余的空白字符合并為一個空格, 但是在注釋和引號中的空白字符不進行任何處理.
安裝方法
1. go get 方式
go get github.com/rwx------/nginxConfigFormatterGo
# 可能會被安裝在如下目錄
$HOME/go/bin/nginxConfigFormatterGo
2. go build 方式
git clone https://github.com/rwx------/nginxConfigFormatterGo.git
cd nginxConfigFormatterGo
go build
3. 預(yù)編譯好的二進制包
你可以在 發(fā)布頁面 獲取預(yù)編譯的二進制包.
# linux
wget https://github.com/rwx------/nginxConfigFormatterGo/releases/download/v1.0.0/nginxConfigFormatterGo_linux_amd64 -O /usr/local/bin/nginxConfigFormatterGo
chmod +x /usr/local/bin/nginxConfigFormatterGo
# mac
wget https://github.com/rwx------/nginxConfigFormatterGo/releases/download/v1.0.0/nginxConfigFormatterGo_darwin_amd64 -O /usr/local/bin/nginxConfigFormatterGo
chmod +x /usr/local/bin/nginxConfigFormatterGo
使用方法
NAME:
nginxConfigFormatterGo - nginx 格式化工具
USAGE:
./nginxConfigFormatterGo [-s 2] [-c utf-8] [-b] [-v] [-t]
DESCRIPTION:
nginx 格式化工具
AUTHOR:
github.com/rwx------
COMMANDS:
help, h 顯示命令列表或單個命令的幫助
GLOBAL OPTIONS:
--charset value, -c value 當(dāng)前支持的字符集: gbk, gb18030, windows-1252, utf-8 (默認: "utf-8")
--space value, -s value 縮進的空格數(shù) (默認: 4)
--backup, -b 備份原始的配置文件
--verbose, -v 冗長模式
--testing, -t 只進行測試, 不真正執(zhí)行
--help, -h 顯示本頁的幫助信