nginxConfigFormatterGo v1.0.0免费版

nginxConfigFormatterGo v1.0.0免费版

  • 版本: v1.0.0免费版
  • 分类:服务器类
  • 大小: 13KB
  • 时间:2021-12-15
  • windows下载
  • 软件介绍
介绍

  nginxConfigFormatterGo是一款nginx配置文件格式化工具,作者使用go语言开发,通过nginxConfigFormatterGo可以根据不同的系统进行打包二进制文件在服务器上使用,执行效率更高。

nginxConfigFormatterGo软件特色

  可预测的格式化结果.

  所有的注释都独立一行.

  连续的多个空行合并为一个空行.

  花括号使用Java的习惯.

  所有的行使用统一的方式进行缩进, 缩进的空格数由用户指定 (默认 4 个空格).

  多余的空白字符合并为一个空格, 但是在注释和引号中的空白字符不进行任何处理.

nginxConfigFormatterGo安装方法

  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. 预编译好的二进制包

  你可以在 发布页面 获取预编译的二进制包.

  # 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

nginxConfigFormatterGo使用方法

  NAME:

  nginxConfigFormatterGo - nginx 格式化工具

  USAGE:

  ./nginxConfigFormatterGo [-s 2] [-c utf-8] [-b] [-v] [-t] <filelists>

  DESCRIPTION:

  nginx 格式化工具

  AUTHOR:

  github.com/rwx------

  COMMANDS:

  help, h  显示命令列表或单个命令的帮助

  GLOBAL OPTIONS:

  --charset value, -c value  当前支持的字符集: gbk, gb18030, windows-1252, utf-8 (默认: "utf-8")

  --space value, -s value    缩进的空格数 (默认: 4)

  --backup, -b               备份原始的配置文件

  --verbose, -v              冗长模式

  --testing, -t              只进行测试, 不真正执行

  --help, -h                 显示本页的帮助信

nginxConfigFormatterGo更新日志

  方式设置缩进的空格数.(默认4个空格缩进)

  支持了更多的文件字符集

  修复了多行配置的分解问题(这个在原python项目中没有修复)

  修复了"和'的配置问题(原python项目中只要匹配到", '就算是在引号内的内容, 前一个是 ", 后一个 ' 时, 会被认为是引号外. 还有在 注释中的" '也会被解析, 造成引号内的内容错乱)

  不必对${variable} 及 rewrite 中的 {}进行特殊处理, 因为nginx配置文件的语法中, 这些时候的花括号都需要被引号包围, 不然语法解析通不过(指 nginx -t ).

  减少了一些不必要的重复处理, 从原来的7次全量读写优化到6次全量读写.

展开