From 481d2985b8c2cd2b0e8f5258e08c819a7c061fa6 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Wed, 22 May 2024 17:15:31 +0100 Subject: [PATCH] Version 2.7.0 --- CHANGELOG.md | 12 ++++++------ go.mod | 2 +- go.sum | 4 ++-- uni.go | 27 +++++++++++++++------------ 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be18816..5ed15f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ -### unreleased +### v2.7.0 (2024-05-22) - Improve `-format` flag: - Add `%name` as an alias for `%(name l:auto)`; this is a lot less typing and requires less shell quoting, and >90% of the time this is what you want. - - Automatically prepend character, codepoint, and name if it starts with a - `+`; for example: + - Automatically prepend character, codepoint, and name if the format flag + starts with `+`; for example: % uni identify -f +'%unicode %plane' a Name Unicode Plane @@ -39,9 +39,9 @@ 'ℱ' U+2131 8497 e2 84 b1 ℱ SCRIPT CAPITAL F [Fourier transform] 'Ⅎ' U+2132 8498 e2 84 b2 Ⅎ TURNED CAPITAL F [Claudian digamma inversum] -- Allow arguments to `print` end with a comma. This comes up when copy/pasting - some list of codepoints from another source; there's no real reason to error - out on this. +- Allow arguments to `print`to start or end with a comma or slash. This comes up + when copy/pasting some list of codepoints from another source; there's no real + reason to error out on this. - Allow listing unicode versions with `uni list unicode` and planes with `uni list planes`. diff --git a/go.mod b/go.mod index 721b949..caf53fd 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( zgo.at/runewidth v0.1.0 zgo.at/termtext v1.5.0 - zgo.at/zli v0.0.0-20240521052840-819d150b8974 + zgo.at/zli v0.0.0-20240522161040-91dbcffb2960 zgo.at/zstd v0.0.0-20240521013615-10baa641d7d0 ) diff --git a/go.sum b/go.sum index fdb10eb..41dfaf7 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,7 @@ zgo.at/runewidth v0.1.0 h1:ED4PzJpYJlZMDEkoz+iPKjb5NrwbKnWPXDMJlNlfk9g= zgo.at/runewidth v0.1.0/go.mod h1:Ugl6FGPF5Ib/NRu2UAV2wVthEgYfEz51Bu/uyNbWZSw= zgo.at/termtext v1.5.0 h1:4p9GVUDYUR8oWvpxOZsO5ZrNSkA99bp8gXNKxKj+Kl0= zgo.at/termtext v1.5.0/go.mod h1:AcdAAiydkqSFadljJaEj9jv7bpyJxfQqGtPWyZCLenQ= -zgo.at/zli v0.0.0-20240521052840-819d150b8974 h1:YDS8AQffen7PNH8wlpEvqimOIfuYaPZP9UM6E0hkb1k= -zgo.at/zli v0.0.0-20240521052840-819d150b8974/go.mod h1:qhnApe1+0zc1rz3S9lbauLTBZstPJMCw9jlH9ly28q8= +zgo.at/zli v0.0.0-20240522161040-91dbcffb2960 h1:EKRLwSV84fLidsIOk4aEe2jrXQJyAsvHZ+jQN19EhXw= +zgo.at/zli v0.0.0-20240522161040-91dbcffb2960/go.mod h1:qhnApe1+0zc1rz3S9lbauLTBZstPJMCw9jlH9ly28q8= zgo.at/zstd v0.0.0-20240521013615-10baa641d7d0 h1:s4v5EAzMGV4ly1t240XidEY1Cq0OuyZSZL57Kbz/Big= zgo.at/zstd v0.0.0-20240521013615-10baa641d7d0/go.mod h1:o/Q8+EtSahHnfkbB3t8wXE0FnoDTmJ0sBDlzezv9XeM= diff --git a/uni.go b/uni.go index eeff267..d321a01 100644 --- a/uni.go +++ b/uni.go @@ -288,23 +288,26 @@ const ( func main() { flag := zli.NewFlags(os.Args) var ( - compact = flag.Bool(false, "c", "compact", "q", "quiet") - help = flag.Bool(false, "h", "help") - rawF = flag.Bool(false, "r", "raw") - pager = flag.Bool(false, "p", "pager") - or = flag.Bool(false, "o", "or") - formatF = flag.String(defaultFormat, "format", "f") - tone = flag.String("", "t", "tone", "tones") - gender = flag.String("person", "g", "gender", "genders") - asF = flag.String("list", "a", "as") - jsonF = flag.Bool(false, "json", "j") + compact = flag.Bool(false, "c", "compact", "q", "quiet") + help = flag.Bool(false, "h", "help") + versionF = flag.Bool(false, "v", "version") + rawF = flag.Bool(false, "r", "raw") + pager = flag.Bool(false, "p", "pager") + or = flag.Bool(false, "o", "or") + formatF = flag.String(defaultFormat, "format", "f") + tone = flag.String("", "t", "tone", "tones") + gender = flag.String("person", "g", "gender", "genders") + asF = flag.String("list", "a", "as") + jsonF = flag.Bool(false, "json", "j") ) zli.F(flag.Parse()) - + if versionF.Set() { + fmt.Println(version) + return + } if pager.Set() { defer zli.PagerStdout()() } - if help.Set() { fmt.Fprint(zli.Stdout, usage) return