Skip to content

Commit c02c9fc

Browse files
author
Nate Fisher
committed
Readme updates
1 parent c67e830 commit c02c9fc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Readme.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
# smlr
2-
Truncates stdin to a maximum fixed size, abbreviating the output if over the specified length.
2+
Truncates `stdin` to a maximum fixed size, abbreviating the output if over the specified length. For example, make a giant git branch name more manageable for use in `PS1`.
33

44
#### Usage
55
`[source] | smlr [-s SIZE] [-a ALIGNMENT]`
66
* `-s`: Size of output. If equal or greater than input, input is relayed to s unchanged"). Default value is 5.
7-
* `-a`: Alignment of output. Can be either `left` or `right`. Default value is middle.
7+
* `-a`: Alignment of output. Can be either middle (if option is omitted), `left` or `right`. Default is middle alignment.
88

99
#### Examples
10-
Bring your git branch down to a fixed-size
10+
Bring your git branch down to a fixed-size:
1111
```
1212
> git rev-parse --abbrev-ref HEAD | smlr -s 10
1313
> feat...-13
1414
```
15-
Deal with too many letters
15+
Deal with too many letters. Sometimes there are too many:
1616
```
1717
> echo "abcdefghijkl" | smlr -s 10 -a right
1818
> ...fghijkl
19+
> echo "abcdefghijkl" | smlr -s 10 -a left
20+
> abcdefg...
1921
```
20-
A date string that's just too long
22+
A date string that's just too long:
2123
```
2224
> date | smlr -s 10
2325
> Thu ...017
2426
```
25-
Repeat the string if it turns out to be equal, or smaller than, the size given
27+
Repeat the string if it turns out to be equal, or smaller than, the size given:
2628
```
2729
> echo "abc" | smlr -s 5
2830
> abc
2931
```
3032

3133
#### Installation
32-
Just run a `make` to build it. If everything works out, you'll have a binary in `build/rel/smlr`. Symlink or copy that sucker to a path directory, such as `/usr/bin`.
34+
Clone the repo and run a `make` to build it. If everything works out, you'll have a binary in `build/rel/smlr`. Symlink or copy that sucker to a path directory, such as `/usr/bin`.

0 commit comments

Comments
 (0)