Download the PHP package drevops/shell-variables-extractor without Composer

On this page you can find all versions of the php package drevops/shell-variables-extractor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package shell-variables-extractor

Shellvar logo

Utility to work with shell variables

[![GitHub Issues](https://img.shields.io/github/issues/AlexSkrypnyk/shellvar.svg)](https://github.com/AlexSkrypnyk/shellvar/issues) [![GitHub Pull Requests](https://img.shields.io/github/issues-pr/AlexSkrypnyk/shellvar.svg)](https://github.com/AlexSkrypnyk/shellvar/pulls) [![Test PHP](https://github.com/AlexSkrypnyk/shellvar/actions/workflows/test-php.yml/badge.svg)](https://github.com/AlexSkrypnyk/shellvar/actions/workflows/test-php.yml) [![codecov](https://codecov.io/gh/AlexSkrypnyk/shellvar/graph/badge.svg?token=7WEB1IXBYT)](https://codecov.io/gh/AlexSkrypnyk/shellvar) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/AlexSkrypnyk/shellvar) ![LICENSE](https://img.shields.io/github/license/AlexSkrypnyk/shellvar) ![Renovate](https://img.shields.io/badge/renovate-enabled-green?logo=renovatebot) [![Docker Pulls](https://img.shields.io/docker/pulls/drevops/shellvar?logo=docker)](https://hub.docker.com/r/drevops/shellvar) ![amd64](https://img.shields.io/badge/arch-linux%2Famd64-brightgreen)

Features

Installation

Download the latest version of the shellvar from the releases page and run on host machine:

or run as a Docker container:

Usage - Lint

Lint file or directory

Example:

Fix file or directory

Example:

Usage - Extract

By default, variable names, descriptions (taken from the comments) and their values are printed to STDOUT in the CSV format. You can also change the output format to Markdown table or Markdown blocks.

Given the following shell script ( see extended example used in tests):

CSV (default)

Markdown table

Click to see output which renders as | Name | Default value | Description | |--------|---------------|-------------------------------------------------------------------------------------------------------------------------------| | `VAR1` | `val1` | Assignment to scalar value. | | `VAR2` | `${VAR1}` | Assignment to another variable. | | `VAR3` | `abc` | Parameter expansion. | | `VAR4` | `${VAR3}` | Parameter expansion with a default value using
another variable `$VAR3`.

Continuation of the multi-line comment. |

Markdown blocks

Click to see output which renders as
### `VAR1` Assignment to scalar value. Default value: `val1` ### `VAR2` Assignment to another variable. Default value: `${VAR1}` ### `VAR3` Parameter expansion. Default value: `abc` ### `VAR4` Parameter expansion with a default value using
another variable `$VAR3`. Continuation of the multi-line comment. Default value: `${VAR3}`

Advanced: Markdown blocks with links and custom template

Click to see output which renders as
### `VAR1` Assignment to scalar value. Default value: `val1` Path: `1.sh` Paths: `1.sh` ### `VAR2` Assignment to another variable. Default value: `${VAR1}` Path: `1.sh` Paths: `1.sh` ### `VAR3` Parameter expansion. Default value: `abc` Path: `1.sh` Paths: `1.sh` ### `VAR4` Parameter expansion with a default value using
another variable [`$VAR3`](#VAR3). Continuation of the multi-line comment. Default value: `${VAR3}` Path: `1.sh` Paths: `1.sh`

Options

There are options for different phases: extraction, filtering and formatting.

"Multiple values allowed" means that you can specify the option multiple times like so: --exclude-prefix=VAR1 --exclude-prefix=VAR2 etc.

Extraction

Name Description Default value
paths File or directory to scan. Multiple files separated by space.
--skip-text=SKIP Skip variable extraction if the comment has this specified text. @skip
--skip-description-prefix=PREFIX Skip description lines that start with the provided prefix. Multiple values allowed.

Filtering

Name Description Default value
--exclude-local Remove local variables.
--exclude-prefix=PREFIX Exclude variables that start with the provided prefix. Multiple values allowed
--exclude-from-file=FILE A path to a file that contains variables to be excluded from the extraction process. Multiple values allowed.

Format

Name Description Default value
--format=FORMAT The output format: CSV (csv), Markdown table (md-table), Markdown blocks (md-blocks). csv
--sort Sort variables in ascending order by name.
--unset A string to represent a value for variables that are defined but have no set value. UNSET
--fields=FIELDS Semicolon-separated list of fields. Each field is a key-label pair in the format "key=label". If label is omitted, key is used as label. name=Name;default_value="Default value;description=Description
--path-strip-prefix=PREFIX Strip the provided prefix from the path.
--csv-separator=SEPARATOR Separator for the CSV output format. ;
--md-link-vars Link variables within usages to their definitions in the Markdown output format.
--md-link-vars-anchor-case The case of the anchors when linking variables. Can be one of "preserve", "lower" or "upper". preserve
--md-no-inline-code-wrap-vars Do not wrap variables to show them as inline code in the Markdown output format.
--md-no-inline-code-wrap-numbers Do not wrap numbers to show them as inline code in the Markdown output format.
--md-inline-code-extra-file=FILE A path to a file that contains additional strings to be formatted as inline code in the Markdown output format. Multiple values allowed.
--md-block-template-file=FILE A path to a Markdown template file used for Markdown blocks (md-blocks) output format. {{ name }}, {{ description }}, {{ default_value }} and {{ path }} tokens can be used within the template.

Maintenance

composer install
composer lint
composer lint:fix
composer test
composer build

Docker publishing

Shellvar is published as a Docker image with the following tags:


This repository was created using the Scaffold project template


All versions of shell-variables-extractor with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
alexskrypnyk/csvtable Version ^1
symfony/console Version ^7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package drevops/shell-variables-extractor contains the following files

Loading the files please wait ....