Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sharkdp/lucid
A simple mock-application for programs that work with child processes
https://github.com/sharkdp/lucid
cli command-line debugging process-control terminal testing tool
Last synced: 6 days ago
JSON representation
A simple mock-application for programs that work with child processes
- Host: GitHub
- URL: https://github.com/sharkdp/lucid
- Owner: sharkdp
- License: apache-2.0
- Created: 2018-09-09T15:03:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-09-02T06:30:22.000Z (about 2 years ago)
- Last Synced: 2024-10-05T16:37:30.546Z (about 2 months ago)
- Topics: cli, command-line, debugging, process-control, terminal, testing, tool
- Language: Rust
- Homepage:
- Size: 86.9 KB
- Stars: 90
- Watchers: 7
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
lucid
=====[![Build Status](https://travis-ci.org/sharkdp/lucid.svg?branch=master)](https://travis-ci.org/sharkdp/lucid)
A simple mock-application that can be used by other programs that work with child processes.
`lucid` is similar to `sleep`, but has a few additional features that can be helpful
when debugging applications that spawn subprocesses.## Demo
## Introduction
Applications or scripts that handle child processes need to deal with a lot of different
scenarios.There are really simple processes that successfully terminate after a short period of time:
``` bash
lucid 2
```Others also finish after some time, but fail with a **non-zero exit code**:
``` bash
lucid 3 --exit-code=1
```Some processes just **run forever** (but can be terminated via `SIGINT` or `SIGTERM`):
``` bash
lucid
```Others refuse to handle **termination signals** properly and just ignore them:
``` bash
lucid 10 --no-interrupt
```There are also processes that choose to **daemonize** themselves immediately:
``` bash
lucid 10 --daemon
```Many processes print a lot on **standard output**:
``` bash
lucid 10 --verbose
```While some others might generate **error messages**:
``` bash
lucid 10 --stderr --verbose
```## Usage
```
USAGE:
lucid [OPTIONS] [duration]OPTIONS:
-c, --exit-codeTerminate with the given exit code [default: 0]
-d, --daemon Daemonize the process after launching
-I, --no-interrupt Do not terminate when receiving SIGINT/SIGTERM signals
-p, --prefix Prefix all messages with the given string [default: lucid]
-v, --verbose Be noisy
-q, --quiet Do not output anything
-e, --stderr Print all messages to stderr
-h, --help Prints help information
-V, --version Prints version informationARGS:
Sleep time in seconds. If no duration is given, the process will sleep forever.
```## Installation
### On Debian-based systems
``` bash
wget "https://github.com/sharkdp/lucid/releases/download/v0.3.0/lucid_0.3.0_amd64.deb"
sudo dpkg -i lucid_0.3.0_amd64.deb
```### On other distrubutions
Check out the [release page](https://github.com/sharkdp/lucid/releases) for binary builds.
### Via cargo
```
cargo install lucid
```