Skip to content

Commit

Permalink
Release 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bensadeh committed Nov 5, 2023
1 parent 4d0c36a commit a86dceb
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 69 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@



## 2.0.0

- Changed the binary name from `spin` to `tspin`

This is a symbolic release to settle on a new binary name with fewer conflicts. Both `tailspin` and `spin` already exist
as binaries in different systems and distributions. `tspin` is a short and unique name that is unlikely to conflict with
other binaries.

## 1.6.1

- Fixed a bug where the `--print` flag would occasionally cause a panic
Expand All @@ -23,7 +31,7 @@
## 1.5.0 - 16.09.23

- Errors are now printed to `stderr` instead of `stdout`
- Date higlighter now supports different highlights for date and time segment
- Date highlighter now supports different highlights for date and time segment
- Added Key Value highlighter
- Added unix process highlighter

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tailspin"
version = "1.7.1"
version = "2.0.0"
edition = "2021"
authors = ["Ben Sadeh"]
description = "A log file highlighter"
Expand All @@ -11,7 +11,7 @@ rust-version = "1.70"

[[bin]]
path = "src/main.rs"
name = "spin"
name = "tspin"

[dependencies]
async-trait = "0.1.74"
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="assets/tailspin.png" width="230"/>
</p>

#
#

<p align="center">
A log file highlighter
Expand Down Expand Up @@ -46,8 +46,10 @@ keywords and more.
it requires no configuration or setup and will work predictably regardless of the format the log file is in.

## Installing

### Package Managers
The binary name for `tailspin` is `spin`.

The binary name for `tailspin` is `tspin`.

```console
# Homebrew
Expand All @@ -65,6 +67,7 @@ nix-shell -p tailspin
# NetBSD
pkgin install tailspin
```

### From Source

```console
Expand Down Expand Up @@ -325,15 +328,15 @@ style = { fg = "red", italic = true }
## Working with `stdin` and `stdout`

By default, `tailspin` will open a file in the pager `less`. However, if you pipe something into `tailspin`, it will
print the highlighted output directly to `stdout`. This is similar to running `spin [file] --print`.
print the highlighted output directly to `stdout`. This is similar to running `tspin [file] --print`.

To let `tailspin` highlight the logs of different commands, you can pipe the output of those commands into `tailspin`
like so:

```console
journalctl -f | spin
cat /var/log/syslog | spin
kubectl logs -f pod_name | spin
journalctl -f | tspin
cat /var/log/syslog | tspin
kubectl logs -f pod_name | tspin
```

## Using the pager `less`
Expand Down
8 changes: 0 additions & 8 deletions completions/spin.fish

This file was deleted.

8 changes: 4 additions & 4 deletions completions/spin.bash → completions/tspin.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_spin() {
_tspin() {
local i cur prev opts cmd
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
Expand All @@ -10,15 +10,15 @@ _spin() {
do
case "${cmd},${i}" in
",$1")
cmd="spin"
cmd="tspin"
;;
*)
;;
esac
done

case "${cmd}" in
spin)
tspin)
opts="-f -t -p -c -l -h -V --follow --tail --print --config-path --follow-command --z-generate-shell-completions --help --version [FILE]"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
Expand Down Expand Up @@ -55,4 +55,4 @@ _spin() {
esac
}

complete -F _spin -o nosort -o bashdefault -o default spin
complete -F _tspin -o nosort -o bashdefault -o default tspin
8 changes: 8 additions & 0 deletions completions/tspin.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
complete -c tspin -s c -l config-path -d 'Path to a custom configuration file' -r
complete -c tspin -s l -l follow-command -d 'Continuously listens to the stdout of the provided command and prevents interrupt events (Ctrl + C) from reaching the command' -r
complete -c tspin -l z-generate-shell-completions -d 'Print completions to stdout' -r
complete -c tspin -s f -l follow -d 'Follow (tail) the contents of the file'
complete -c tspin -s t -l tail -d 'Start at the end of the file'
complete -c tspin -s p -l print -d 'Print the output to stdout'
complete -c tspin -s h -l help -d 'Print help'
complete -c tspin -s V -l version -d 'Print version'
16 changes: 8 additions & 8 deletions completions/spin.zsh → completions/tspin.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#compdef spin
#compdef tspin

autoload -U is-at-least

_spin() {
_tspin() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
Expand Down Expand Up @@ -34,14 +34,14 @@ _spin() {
&& ret=0
}

(( $+functions[_spin_commands] )) ||
_spin_commands() {
(( $+functions[_tspin_commands] )) ||
_tspin_commands() {
local commands; commands=()
_describe -t commands 'spin commands' commands "$@"
_describe -t commands 'tspin commands' commands "$@"
}

if [ "$funcstack[1]" = "_spin" ]; then
_spin "$@"
if [ "$funcstack[1]" = "_tspin" ]; then
_tspin "$@"
else
compdef _spin spin
compdef _tspin tspin
fi
10 changes: 5 additions & 5 deletions man/spin.1 → man/tspin.1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'\" t
.\" Title: spin
.\" Title: tspin
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2023-11-01
.\" Date: 2023-11-05
.\" Manual: tailspin
.\" Source: tailspin 1.6.1
.\" Source: tailspin 2.0.0
.\" Language: English
.\"
.TH "SPIN" "1" "2023-11-01" "tailspin 1.6.1" "tailspin"
.TH "TSPIN" "1" "2023-11-05" "tailspin 2.0.0" "tailspin"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
Expand All @@ -28,7 +28,7 @@
. LINKSTYLE blue R < >
.\}
.SH "NAME"
spin \- A log file highlighter
tspin \- A log file highlighter
.SH "SYNOPSIS"
.sp
\fBspin\fP [\fIOPTION\fP]... [\fIFILE\fP|\fIFOLDER\fP]...
Expand Down
2 changes: 1 addition & 1 deletion src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::io;
use std::process::exit;

#[derive(Parser)]
#[command(name = "spin")]
#[command(name = "tspin")]
#[command(author, version, about)]
pub struct Cli {
/// Path to file or folder
Expand Down
2 changes: 1 addition & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ fn validate_input(
if !has_data_from_stdin && !has_file_or_folder_input && !has_follow_command_input {
return Err(Error {
exit_code: OK,
message: format!("Missing filename ({} for help)", "spin --help".magenta()),
message: format!("Missing filename ({} for help)", "tspin --help".magenta()),
});
}

Expand Down
24 changes: 0 additions & 24 deletions tailspin.rb

This file was deleted.

4 changes: 2 additions & 2 deletions util/generate_man_pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ set -e # If any command fails, stop the script immediately
full_version=$(cargo run -- -V)
version_number=$(echo "$full_version" | awk '{print $2}')

touch spin.adoc
touch tspin.adoc

asciidoctor -b manpage spin.adoc \
asciidoctor -b manpage tspin.adoc \
--destination=../man/ \
--attribute release-version="$version_number"
8 changes: 4 additions & 4 deletions util/generate_shell_completions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ cd ..
cargo build

# Path to the built binary
spin_path=./target/debug/spin
spin_path=./target/debug/tspin

# Generate shell completions
$spin_path --z-generate-shell-completions zsh > completions/spin.zsh
$spin_path --z-generate-shell-completions bash > completions/spin.bash
$spin_path --z-generate-shell-completions fish > completions/spin.fish
$spin_path --z-generate-shell-completions zsh > completions/tspin.zsh
$spin_path --z-generate-shell-completions bash > completions/tspin.bash
$spin_path --z-generate-shell-completions fish > completions/tspin.fish
4 changes: 2 additions & 2 deletions util/spin.adoc → util/tspin.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= spin(1)
= tspin(1)
:doctype: manpage
:manmanual: tailspin
:man source: tailspin {release-version}
Expand All @@ -13,7 +13,7 @@ endif::[]

== NAME

spin - A log file highlighter
tspin - A log file highlighter

== SYNOPSIS

Expand Down

0 comments on commit a86dceb

Please sign in to comment.