semvec/pypi-packages huggingface dataset:
sub-do 0.2.0
Command-line application to run commands in subdirectories.
License: Apache License, Version 2.0
Requires Python: >=3.6

# Sub-do

[![PyPI](https://img.shields.io/pypi/v/sub-do.svg)](https://pypi.org/project/sub-do/)
[![Updates](https://pyup.io/repos/github/fniessink/sub-do/shield.svg)](https://pyup.io/repos/github/fniessink/sub-do/)

Command-line application to run commands in subdirectories.

## Table of contents

- [Installation](#installation)
- [Usage](#usage)
- [Recent changes](#recent-changes)
- [Developing *Sub-do*](#developing-sub-do)
  - [Installing the development environment and dependencies](#installing-the-development-environment-and-dependencies)
  - [Running unit tests](#running-unit-tests)
  - [Generating documentation](#generating-documentation)

## Installation

*Sub-do* requires Python 3.6 or newer.

`pip install --upgrade sub-do`

## Usage

```console
$ sub-do --help
usage: sub-do [-h] [-V] [-d [directory [directory ...]]] command

positional arguments:
  command               command to run

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -d [directory [directory ...]], --directory [directory [directory ...]]
                        directories to run the command in (default: all subdirectories except those whose
                        names begin with a dot)

When using -d, use -- to separate directories from the command or put the command first
```

To run a command in all subdirectories of the current directory:

```console
$ sub-do 'ls | wc -l'
['ls | wc -l' in sub_do/ exited with 0]
[stdout]
       3

['ls | wc -l' in dist/ exited with 0]
[stdout]
       2

['ls | wc -l' in ci/ exited with 0]
[stdout]
       2

['ls | wc -l' in tests/ exited with 0]
[stdout]
       3

['ls | wc -l' in sub_do.egg-info/ exited with 0]
[stdout]
       6

['ls | wc -l' in docs/ exited with 0]
[stdout]
       2

['ls | wc -l' in build/ exited with 0]
[stdout]
       4
```

## Recent changes

See the [change log](https://github.com/fniessink/sub-do/blob/master/CHANGELOG.md).

## Developing *Sub-do*

### Installing the development environment and dependencies

Run `pip install -r requirements-dev.txt` to install the development dependencies.

### Running unit tests

To run the unit tests and check their code coverage:

```console
$ ci/unittest.sh
----------------------------------------------------------------------
Ran 14 tests in 0.017s

OK
Name    Stmts   Miss Branch BrPart  Cover
-----------------------------------------
-----------------------------------------
TOTAL     115      0     21      0   100%

7 files skipped due to complete coverage.
```

The HTML coverage report is written to `build/unittest-coverage/`.

### Generating documentation

This `README.md` file is generated with `python docs/generate_readme.py`.