Skip to content

Commit 5b7d5c9

Browse files
Update README.md
1 parent e155a6a commit 5b7d5c9

File tree

1 file changed

+80
-46
lines changed

1 file changed

+80
-46
lines changed

β€ŽREADME.md

Lines changed: 80 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3,74 +3,108 @@
33
[![Build Status](https://app.travis-ci.com/PeterDaveHello/ColorEchoForShell.svg?branch=master)](https://app.travis-ci.com/PeterDaveHello/ColorEchoForShell)
44
![License badge](https://img.shields.io/badge/license-GPL%20v2.0-brightgreen.svg)
55

6-
Make echo colorful with easier method. In [bash](https://www.gnu.org/software/bash/), [sh](https://en.wikipedia.org/wiki/Bourne_shell), [fish](http://fishshell.com/), [ksh](http://www.kornshell.com/) and [zsh](http://www.zsh.org/). Which can help you print debug, warning, error message in shell scripts with meaningful colors, and make the output more readable.
6+
**ColorEchoForShell** brings life to your shell scripts by making text output colorful and meaningful. Whether you're debugging, displaying warnings, or showcasing errors, ColorEchoForShell enhances readability and helps you quickly identify messages in various shell environments.
77

8-
Please note that [certain colors](https://github.com/PeterDaveHello/ColorEchoForShell/blob/master/color%20table.txt#L9-L12) will really depend on the environment, different terminal may have different behavior, terminal multiplexer like tmux could also affect the result, especially those color not coded in range 0~7, might have unexpected result with styling. My demo is under a terminal called [Terminator](http://gnometerminator.blogspot.com/p/introduction.html), you can simply install it via apt, yum, pkg or other package manager. Actually, all the colors display depend on the environment setting, but I just name/define name by the most common cases I know by far.
8+
## Quick Start
99

10-
## MENU
10+
1. Download the appropriate script for your shell (e.g., bash, sh, fish, ksh, zsh).
1111

12-
* [`MENU`](#menu)
13-
* [`Installation`](#installation)
14-
* [`Usage`](#usage)
15-
* [`Examples`](#examples)
16-
* [`Supported shells`](#supported-shells)
17-
* [`Supported styles`](#supported-styles)
18-
* [`Supported colors`](#supported-colors)
19-
* [`Notes`](#notes)
20-
* [`Screenshot`](#screenshot)
21-
* [`Demo`](#demo)
22-
* [`Author`](#author)
12+
- For bash, download [dist/ColorEcho.bash](./dist/ColorEcho.bash).
13+
- For other shells, choose the corresponding file from the [dist directory](./dist).
14+
15+
2. Source the script in your shell:
16+
17+
```bash
18+
. ./ColorEcho.bash # For bash
19+
```
20+
21+
Replace `ColorEcho.bash` with the appropriate filename for your shell.
22+
23+
3. Try a colorful echo:
24+
25+
```bash
26+
echo.Cyan "Hello, colorful world!"
27+
```
28+
29+
## Features
30+
31+
- **Versatile Compatibility**: Works with [bash](https://www.gnu.org/software/bash/), [sh](https://en.wikipedia.org/wiki/Bourne_shell), [fish](http://fishshell.com/), [ksh](http://www.kornshell.com/), and [zsh](http://www.zsh.org/).
32+
- **Easy to Use**: Simple syntax for applying styles and colors.
33+
- **Customizable**: Supports various styles including bold, italic, underline, blink, and strikethrough.
34+
- **Environment-Dependent Colors**: Please note that [certain colors](./color%20table.txt#L9-L12) may vary depending on the terminal and environment settings.
35+
36+
## Table of Contents
37+
38+
- [Installation](#installation)
39+
- [Usage](#usage)
40+
- [Examples](#examples)
41+
- [Supported Shells](#supported-shells)
42+
- [Supported Styles](#supported-styles)
43+
- [Supported Colors](#supported-colors)
44+
- [Additional Features](#additional-features)
45+
- [Community Contribution](#community-contribution)
46+
- [Screenshots](#screenshots)
47+
- [Demo](#demo)
48+
- [License](#license)
49+
- [Author](#author)
2350

2451
## Installation
2552

26-
* Download the script, choice the one for your shell by its extension in the filename.
27-
* For example [dist/ColorEcho.bash](https://cdn.rawgit.com/PeterDaveHello/ColorEchoForShell/v0.0.7/dist/ColorEcho.bash) for bash.
28-
* Add a line to include the script in your shell rc or run it directly:
53+
To utilize ColorEchoForShell in your shell scripts, first download the appropriate script for your specific shell from the [dist directory](./dist). Then, include the ColorEchoForShell script at the beginning of your script by sourcing it:
2954

30-
`. ./ColorEcho.bash`
55+
```bash
56+
source ./ColorEcho.bash
57+
```
58+
59+
Replace `./ColorEcho.bash` with the relative path to the downloaded ColorEchoForShell script.
60+
61+
This inclusion will enable all the features of ColorEchoForShell within your script.
3162

3263
## Usage
3364

34-
* echo.`StyleColor` (if you are using `ksh`/`sh`, there is no `.` dot symbol), you can combine at most two styles together, the order of the style doesn't matter.
65+
Use the `echo.StyleColor` syntax to print colorful text. In `ksh`/`sh`, omit the `.` dot symbol. You can combine up to two styles, and the order doesn't matter.
3566
3667
### Examples
3768
38-
* echo.Cyan
39-
* echo.ICyan
40-
* echo.ULCyan
41-
* echo.BLCyan
42-
* echo.STCyan
43-
* echo.BoldCyan
44-
* echo.BoldULCyan
45-
* echo.ULBoldCyan
69+
- `echo.Cyan`: Prints text in cyan color.
70+
- `echo.ICyan`: Prints text in italic cyan.
71+
- `echo.ULCyan`: Prints text in underline cyan.
72+
- `echo.BLCyan`: Prints text in blinking cyan.
73+
- `echo.STCyan`: Prints text with strikethrough in cyan.
74+
- `echo.BoldCyan`: Prints text in bold cyan.
75+
- `echo.BoldULCyan`: Prints text in bold underline cyan.
76+
- `echo.ULBoldCyan`: Prints text in underline bold cyan.
77+
78+
## Supported Shells
4679
47-
## Supported shells
80+
- [Bourne shell (sh)](https://en.wikipedia.org/wiki/Bourne_shell)
81+
- [Bourne-Again shell (bash)](https://www.gnu.org/software/bash/)
82+
- [Z shell (Zsh)](http://zsh.sourceforge.net/)
83+
- [Korn shell (ksh)](http://www.kornshell.org/)
84+
- [Friendly interactive shell (fish)](http://fishshell.com/)
4885
49-
* [Bourne shell (sh)](https://en.wikipedia.org/wiki/Bourne_shell)
50-
* [Bourne-Again shell (bash)](https://www.gnu.org/software/bash/)
51-
* [Z shell (Zsh)](http://zsh.sourceforge.net/)
52-
* [Korn shell (ksh)](http://www.kornshell.org/)
53-
* [Friendly interactive shell (fish)](http://fishshell.com/)
86+
## Supported Styles
5487
55-
## Supported styles
88+
- Bold: `Bold`
89+
- Italic: `I`
90+
- Underline: `UL`
91+
- Blink: `BL`
92+
- Strikethrough: `ST`
5693
57-
* Bold as `Bold`
58-
* Italic as `I`
59-
* Underline as `UL`
60-
* Blink as `BL`
61-
* Strikethrough as `ST`
94+
## Supported Colors
6295
63-
## Supported colors
96+
- Refer to the [color table](./color%20table.txt).
97+
- Use the `Light` keyword for lighter versions of standard colors (coded in range 0~7), e.g., `LightYellow`.
6498
65-
* See [color table](https://github.com/PeterDaveHello/ColorEchoForShell/blob/master/color%20table.txt)
99+
## Additional Features
66100
67-
* For the standard color(coded in range 0~7), it'll has a light version of the color, just use the `Light` keyword before the color, for example: `LightYellow`.
101+
- **Rainbow Output**: If you have [lolcat](https://github.com/busyloop/lolcat), try `echo.Rainbow`.
68102
69-
## Notes
103+
## Community Contribution
70104
71-
* If you have [lolcat](https://github.com/busyloop/lolcat), you can also try `echo.Rainbow`.
105+
We welcome contributions, bug reports, and suggestions. Feel free to open an issue or submit a pull request.
72106
73-
## Screenshot
107+
## Screenshots
74108
75109
![Screenshot](Demo.png)
76110
@@ -84,4 +118,4 @@ GPL-2.0 (GNU GENERAL PUBLIC LICENSE Version 2)
84118
85119
## Author
86120
87-
[Peter Dave Hello](https://www.peterdavehello.org/), [@Twitter](https://twitter.com/PeterDaveHello), [@GitHub](https://github.com/PeterDaveHello)
121+
[Peter Dave Hello](https://www.peterdavehello.org/), [@Twitter](https://twitter.com/PeterDaveHello), [@GitHub](https://github.com/PeterDaveHello), [@GitLab](https://gitlab.com/PeterDaveHello)

0 commit comments

Comments
Β (0)