https://github.com/linus789/xcol
https://github.com/linus789/xcol
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/linus789/xcol
- Owner: Linus789
- License: mit
- Created: 2021-05-21T17:47:50.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-30T18:38:45.000Z (over 3 years ago)
- Last Synced: 2025-02-28T06:55:04.251Z (over 1 year ago)
- Language: Rust
- Homepage: https://crates.io/crates/xcol
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xcol
xcol is an alternative to [column(1)](https://man7.org/linux/man-pages/man1/column.1.html) with better ansi/color support.
Update: I found out `column` didn’t work because I had `LC_ALL=C` set.
## Installation
In order to install, just run the following command
```
cargo install --force xcol
```
This will install git-user in your `~/.cargo/bin` (or Windows: `%USERPROFILE%\.cargo\bin`).
Make sure to add the `~/.cargo/bin` (or Windows: `%USERPROFILE%\.cargo\bin`) directory to your PATH variable.
## Comparison
column:
```
$ echo -e "I \033[0;31m\033[?1000hlike Stack Overflow\n\033[0mI like \033[0;31mcolors :)" | column -t -o " "
I like Stack Overflow
I like colors :)
```
xcol:
```
$ echo -e "I \033[0;31m\033[?1000hlike Stack Overflow\n\033[0mI like \033[0;31mcolors :)" | xcol -o " "
I like Stack Overflow
I like colors :)
```

## Help menu
```
xcol 0.1
Linus789
USAGE:
xcol [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-a, --alignment
Specify a column's alignment, may be repeated (default is left)
Use 'l', 'r', 'c' for left, right, center alignment
Examples:
All columns left: xcol --alignment l
Left, center, right: xcol --alignment lcr
-o, --output-separator
Specify the possible input item delimiters (default is whitespace)
-s, --separator
Specify the columns delimiter for table output (default is whitespace)
```