diff --git a/CHANGELOG.md b/CHANGELOG.md
index 773e6e2..ba47e2c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
@@ -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
diff --git a/Cargo.lock b/Cargo.lock
index 4999842..be01990 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -898,7 +898,7 @@ dependencies = [
[[package]]
name = "tailspin"
-version = "1.7.1"
+version = "2.0.0"
dependencies = [
"async-trait",
"clap",
diff --git a/Cargo.toml b/Cargo.toml
index 148f97a..f26cbb1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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"
@@ -11,7 +11,7 @@ rust-version = "1.70"
[[bin]]
path = "src/main.rs"
-name = "spin"
+name = "tspin"
[dependencies]
async-trait = "0.1.74"
diff --git a/README.md b/README.md
index 313791b..53cdf8c 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
A log file highlighter @@ -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 @@ -65,6 +67,7 @@ nix-shell -p tailspin # NetBSD pkgin install tailspin ``` + ### From Source ```console @@ -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` diff --git a/completions/spin.fish b/completions/spin.fish deleted file mode 100644 index 4c7a77a..0000000 --- a/completions/spin.fish +++ /dev/null @@ -1,8 +0,0 @@ -complete -c spin -s c -l config-path -d 'Path to a custom configuration file' -r -complete -c spin -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 spin -l z-generate-shell-completions -d 'Print completions to stdout' -r -complete -c spin -s f -l follow -d 'Follow (tail) the contents of the file' -complete -c spin -s t -l tail -d 'Start at the end of the file' -complete -c spin -s p -l print -d 'Print the output to stdout' -complete -c spin -s h -l help -d 'Print help' -complete -c spin -s V -l version -d 'Print version' diff --git a/completions/spin.bash b/completions/tspin.bash similarity index 93% rename from completions/spin.bash rename to completions/tspin.bash index 02f8e82..5740be0 100644 --- a/completions/spin.bash +++ b/completions/tspin.bash @@ -1,4 +1,4 @@ -_spin() { +_tspin() { local i cur prev opts cmd COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" @@ -10,7 +10,7 @@ _spin() { do case "${cmd},${i}" in ",$1") - cmd="spin" + cmd="tspin" ;; *) ;; @@ -18,7 +18,7 @@ _spin() { 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}") ) @@ -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 diff --git a/completions/tspin.fish b/completions/tspin.fish new file mode 100644 index 0000000..21f9f98 --- /dev/null +++ b/completions/tspin.fish @@ -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' diff --git a/completions/spin.zsh b/completions/tspin.zsh similarity index 85% rename from completions/spin.zsh rename to completions/tspin.zsh index a19c6a4..254d4d4 100644 --- a/completions/spin.zsh +++ b/completions/tspin.zsh @@ -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 @@ -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 diff --git a/man/spin.1 b/man/tspin.1 similarity index 90% rename from man/spin.1 rename to man/tspin.1 index 5ff651c..221e985 100644 --- a/man/spin.1 +++ b/man/tspin.1 @@ -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 @@ -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]... diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 460a36e..ca3165a 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -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 diff --git a/src/config/mod.rs b/src/config/mod.rs index dd90632..aba3a61 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -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()), }); } diff --git a/tailspin.rb b/tailspin.rb deleted file mode 100644 index 63ff9e8..0000000 --- a/tailspin.rb +++ /dev/null @@ -1,24 +0,0 @@ -class Tailspin < Formula - desc "Log file highlighter" - homepage "https://github.com/bensadeh/tailspin" - url "https://github.com/bensadeh/tailspin/archive/refs/tags/1.6.1.tar.gz" - sha256 "244163902523c9350658dca6b9e74aaddeb7635bd9195e21f8cfde0b62844e8e" - license "MIT" - - livecheck do - url "https://github.com/bensadeh/tailspin/releases/tag/" - regex(/href=.*?tailspin[._-]v?(\d+(?:\.\d+)+)\.t/i) - end - - depends_on "rust" => :build - - conflicts_with "spin", because: "spin also ships a spin binary" - - def install - system "cargo", "install", *std_cargo_args - end - - test do - system bin/"spin", "--help" - end -end diff --git a/util/generate_man_pages.sh b/util/generate_man_pages.sh index 71a3da3..7d53254 100755 --- a/util/generate_man_pages.sh +++ b/util/generate_man_pages.sh @@ -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" \ No newline at end of file diff --git a/util/generate_shell_completions.sh b/util/generate_shell_completions.sh index 8b51209..b3040d6 100755 --- a/util/generate_shell_completions.sh +++ b/util/generate_shell_completions.sh @@ -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 diff --git a/util/spin.adoc b/util/tspin.adoc similarity index 96% rename from util/spin.adoc rename to util/tspin.adoc index a0bea2e..7c1491f 100644 --- a/util/spin.adoc +++ b/util/tspin.adoc @@ -1,4 +1,4 @@ -= spin(1) += tspin(1) :doctype: manpage :manmanual: tailspin :man source: tailspin {release-version} @@ -13,7 +13,7 @@ endif::[] == NAME -spin - A log file highlighter +tspin - A log file highlighter == SYNOPSIS