mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
feat(version): print the version like gh version
tea version and --version printed "Version: development<TAB>golang: 1.27.2". They now print "tea version 1.0.0 (2026-10-01)", the release notes URL for tagged releases, and "built with go1.27.2" with the build tags. Builds from go install take the module version from the build info, and the date comes from the commit the binary was built from. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
3 files changed
+75
-13
No files matched your search
@@ -16,6 +16,7 @@ import (
|
||||
"unicode"
|
||||
|
||||
"gitea.dev/tea/internal/clierr"
|
||||
"gitea.dev/tea/internal/version"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -68,7 +69,7 @@ func TestCommandLineEdgeCases(t *testing.T) {
|
||||
err = Execute(context.Background(), deps, []string{"config", "list", "--jq", ".[", "--remote", "-h"})
|
||||
require.ErrorContains(t, err, "invalid --jq expression")
|
||||
require.NoError(t, Execute(context.Background(), deps, []string{"--version"}))
|
||||
require.NotContains(t, out.String(), "tea version")
|
||||
require.Equal(t, version.Format()+"\n", out.String())
|
||||
}
|
||||
|
||||
func TestAliasesAfterGlobalFlagsAndNestedHelp(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user