𝌔 Fossil Hub
Login | Fossil manual |
phptags tag tidier

Check-in [ea0942e7b9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Change --color handling to use XOR according to documentation, note about --recursive directory traversal being always on.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ea0942e7b9e85439504fe840b107da19da5b8671
User & Date: mario 2014-11-11 12:00:07
Context
2014-11-11
12:01
Rewritten intro, general formatting (italic for tags, bold for cmdline opts), details on -D and config override file, env vars, and note about --recursive being builtin. check-in: caa59654f2 user: mario tags: trunk
12:00
Change --color handling to use XOR according to documentation, note about --recursive directory traversal being always on. check-in: ea0942e7b9 user: mario tags: trunk
2014-11-07
00:27
Changelog for automatic updates on http://freshcode.club/projects/phptags. check-in: 6f60f03b1a user: mario tags: trunk
Changes

Changes to phptags.

1
2
3
4
5
6
7
8
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
...
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/php -qCdshort_open_tag=1
<?php
/**
 * api: cli
 * type: application
 * title: PHP tag tidier
 * description: Rewrites PHP scripts' short/long open tags, close tags, apply whitespace fixes
 * version: 1.1
................................................................................
        "close" => argv("-c", "-close", "--close", "-closed", "--closed", "--add-closing"),
        "white" => argv("-w", "-white", "--white", "--whitespace", "-ws", "--ws", "-space", "--space", "--fix-whitespace", "--bom"),
        "warn" => argv("-W", "-warn", "--warn", "--warning"),
//"html" => argv("-H", "-html", "--html", "-text", "--text", "-content", "--content"), # warn also about plain HTML outside of PHP code
        "recursive" => true + argv("-r"),        # doing that anyway
        "regex" => argv("--regex", "--rx", "-rx"),   # use regex
        "token" => argv("--tokenizer", "--token", "-t"),# use tokenizer
        "color" => argv("-c", "--color", "--ansi") or isset($_SERVER["TERM"]),    # colorize some output
        "quiet" => argv("--quiet", "-quiet", "-q"),
        "verbose" => argv("--verbose", "-verbose", "-v"),
        "debug" => argv("--debug", "-D"),
        "dry" => argv("--dry", "-d"),            # dry run, don't save files
        "new" => argv("--new", "--suffix"),      # save files under file.php.new
        "backup" => argv("-b", "--backup"),      # renames to file.php~ before overwriting
        "version" => argv("--version", "-V"),
................................................................................
More options:
   -D  --debug     Development notices.
   -d  --dry       Dry run, don't update files.
   -n  --new       Create file.php.new for updated files.
   -b  --backup    Create file.php~ backup files on edits.
   -54 --php54     Keep <?= always for --long conversion.
   -7  --php7      Probe for ASP style <% and super long PHP <script> tags. Use in --warn mode, no rewriting is attempted (too rare).
   -r  --recursive Traverse subdirectories.
   -c  --color     Colorize messages.
   -q  --quiet     Supress notices.
   -V  --version   Print phptags version.\n\n
VERBOSE;
}

// no command-line options were given, so print a short help
|







 







|







 







|







1
2
3
4
5
6
7
8
..
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
...
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/php -qCdshort_open_tag=1 
<?php
/**
 * api: cli
 * type: application
 * title: PHP tag tidier
 * description: Rewrites PHP scripts' short/long open tags, close tags, apply whitespace fixes
 * version: 1.1
................................................................................
        "close" => argv("-c", "-close", "--close", "-closed", "--closed", "--add-closing"),
        "white" => argv("-w", "-white", "--white", "--whitespace", "-ws", "--ws", "-space", "--space", "--fix-whitespace", "--bom"),
        "warn" => argv("-W", "-warn", "--warn", "--warning"),
//"html" => argv("-H", "-html", "--html", "-text", "--text", "-content", "--content"), # warn also about plain HTML outside of PHP code
        "recursive" => true + argv("-r"),        # doing that anyway
        "regex" => argv("--regex", "--rx", "-rx"),   # use regex
        "token" => argv("--tokenizer", "--token", "-t"),# use tokenizer
        "color" => argv("-c", "--color", "--ansi") xor isset($_SERVER["TERM"]),    # colorize some output
        "quiet" => argv("--quiet", "-quiet", "-q"),
        "verbose" => argv("--verbose", "-verbose", "-v"),
        "debug" => argv("--debug", "-D"),
        "dry" => argv("--dry", "-d"),            # dry run, don't save files
        "new" => argv("--new", "--suffix"),      # save files under file.php.new
        "backup" => argv("-b", "--backup"),      # renames to file.php~ before overwriting
        "version" => argv("--version", "-V"),
................................................................................
More options:
   -D  --debug     Development notices.
   -d  --dry       Dry run, don't update files.
   -n  --new       Create file.php.new for updated files.
   -b  --backup    Create file.php~ backup files on edits.
   -54 --php54     Keep <?= always for --long conversion.
   -7  --php7      Probe for ASP style <% and super long PHP <script> tags. Use in --warn mode, no rewriting is attempted (too rare).
   -r  --recursive Traversing subdirectories is enabled per default.
   -c  --color     Colorize messages.
   -q  --quiet     Supress notices.
   -V  --version   Print phptags version.\n\n
VERBOSE;
}

// no command-line options were given, so print a short help