定制 cebe/indent 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cebe/indent

最新稳定版本:1.1.0

Composer 安装命令:

composer require cebe/indent

包简介

A small tool to convert text file indentation.

README 文档

README

A small tool to convert (or enforce) text file indentation. Tabs to spaces or spaces to tabs.

Installation

Install via composer or just clone the repo.

Global installation

Install it globally using:

composer global require cebe/indent

Make sure your composer directory ($HOME/.composer/vendor/bin) is in your PATH.

Usage

indent [--tabs|--spaces] [-r [--pattern=...]] [files or directories...]

--tabs       convert all indentation to tabs. Assuming 4 spaces tab length.
--spaces     convert all indentation to spaces.

-r           recursively go over all directories given as argument and convert
             files that match --pattern.

--pattern    the pattern to match files for when using -r. Defaults to '*.php'.

--tabstop=N  define number of spaces N to replace a tab with. Defaults to 4.

--help       shows this usage information.

If no file is specified input will be read from STDIN.

Examples

Convert myfile.php to tabs:

indent --tabs myfile.php

Convert all .php-files and the README.md in current dir to spaces:

indent --spaces *.php README.md

Convert all .php-files in dir to tabs (recursively):

indent --tabs -r dir

Convert all .md-files in dir to spaces (recursively):

indent --spaces --pattern=*.md -r dir

Convert STDIN, which is the content of myfile.php to spaces and print the result to STDOUT:

cat myfile.php | ./indent --spaces

统计信息

  • 总下载量: 608.83k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 17
  • 点击次数: 1
  • 依赖项目数: 30
  • 推荐数: 0

GitHub 信息

  • Stars: 17
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-04-15