PHPackages                             fabiang/cludearg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. fabiang/cludearg

ArchivedLibrary[CLI &amp; Console](/categories/cli)

fabiang/cludearg
================

Normalizer library for command line arguments for in- or exclude paths and files

24PHP

Since Jul 4Pushed 11y ago1 watchersCompare

[ Source](https://github.com/fabiang/cludearg)[ Packagist](https://packagist.org/packages/fabiang/cludearg)[ RSS](/packages/fabiang-cludearg/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

fabiang/cludearg
================

[](#fabiangcludearg)

Normalizer library for command line arguments for in- or exclude paths and files

[![Build Status](https://camo.githubusercontent.com/2f432713230370d15b974d004e94a5408c5fb87e1b243fe4a1125ea4c84f551f/68747470733a2f2f7472617669732d63692e6f72672f66616269616e672f636c7564656172672e737667)](https://travis-ci.org/fabiang/cludearg) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/bfdecd0bb73419996a81c5aefb3dbdfafbb5ff4f39dbf803282bc2ffbdb8f592/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66616269616e672f636c7564656172672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fabiang/cludearg/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/171c8ddd0829b9d63c541adc9a566926924c6eb442ffc52bf71477dd98435ab0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66616269616e672f636c7564656172672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fabiang/cludearg/?branch=master) [![SensioLabsInsight](https://camo.githubusercontent.com/a9fb0e0083e26f5c8fbab6ef90cf9a1c6308dabc0a4bc954e3d0df87d15c70d8/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32366134663531652d333533312d346439362d383339362d6333396461336331386132312f6d696e692e706e67)](https://insight.sensiolabs.com/projects/26a4f51e-3531-4d96-8396-c39da3c18a21) [![Dependency Status](https://camo.githubusercontent.com/2949299957a504753f39235c8c8e6fb6a4b34bba5bc04ecdb665279aa09fe4e7/68747470733a2f2f67656d6e617369756d2e636f6d2f66616269616e672f636c7564656172672e737667)](https://gemnasium.com/fabiang/cludearg) [![Latest Stable Version](https://camo.githubusercontent.com/345bedbfd065d8a36f47ec65cca88eb857ca84470c37c76e1e5663d7f6460fbd/68747470733a2f2f706f7365722e707567782e6f72672f66616269616e672f636c7564656172672f762f737461626c652e737667)](https://packagist.org/packages/fabiang/cludearg) [![License](https://camo.githubusercontent.com/8de6b45824995059c53b597353294ef43896a61641cdc2b0e70aeffa67c8df57/68747470733a2f2f706f7365722e707567782e6f72672f66616269616e672f636c7564656172672f6c6963656e73652e737667)](https://packagist.org/packages/fabiang/cludearg)

When running code checks against your code (manually or automatically via continues integration) you'll have to define paths/files that should (includes) and paths/files that shouldn't (excludes) be checked by the various applications.

The problem is that all those tools define the command-line arguments in a different way. This library instead accepts only a standardized format and can return the application-format for a given application name and version.

SUPPORTED APPLICATIONS
----------------------

[](#supported-applications)

- php/lint (php -l)
- squizlabs/php\_codesniffer
- phpmd/phpmd
- phpdocumentor/phpdocumentor
- pdepend/pdepend
- sebastian/phpcpd

INSTALLATION
------------

[](#installation)

New to Composer? Read the [introduction](https://getcomposer.org/doc/00-intro.md#introduction). Add the following to your composer file:

```
{
    "require": {
        "fabiang/cludearg": "1.0.x-dev as 1.0.0"
    }
}
```

USAGE
-----

[](#usage)

You'll only need one method:

```
Fabiang\Cludearg\Cludearg::getArgument(
    string $application,
    string $version,
    array $include,
    array $exclude,
    string $path
)

```

Example:

```
use Fabiang\Cludearg\Cludearg;

$cludearg = new Cludearg();

$arguments = $cludearg->getArgument(
    'squizlabs/php_codesniffer',
    '1.0.1',
    array('bin/foo.php', 'src'), // files and folders to be included
    array('vendor', 'tests'), // files and folders to be excluded
    '/myproject' // path where the project can be found
);
```

All paths for in- and exclude must be relative to the given path. The constructor of `Cludearg` can optionally take an `Definition` object, which allows you to add your own definition of arguments.

SYSTEM REQUIREMENTS
-------------------

[](#system-requirements)

- PHP &gt;=5.3
- seld/jsonlint &gt;= 1.1

LICENSE
-------

[](#license)

BSD-2-Clause. See the [LICENSE](LICENSE.md).

CONTRIBUTING
------------

[](#contributing)

Contributing is easy, just make sure the tests are running:

```
./vendor/bin/phpunit -c tests

```

If you change the default definition file check if the json schema validates:

```
./vendor/bin/validate-json definition.json schema/cludearg.json

```

Also Jsonlint may help you to find errors in the definition file:

```
./vendor/bin/jsonlint definition.json

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a001be2e312db9f65923d77f79e8e94e659963fb9e5b19c766c90ddb7e0c3dd0?d=identicon)[fabiang](/maintainers/fabiang)

---

Top Contributors

[![fabiang](https://avatars.githubusercontent.com/u/348344?v=4)](https://github.com/fabiang "fabiang (58 commits)")

### Embed Badge

![Health badge](/badges/fabiang-cludearg/health.svg)

```
[![Health](https://phpackages.com/badges/fabiang-cludearg/health.svg)](https://phpackages.com/packages/fabiang-cludearg)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
