Skip to content

Commit 9ef74c5

Browse files
committed
improve readme and version
Signed-off-by: Yves Brissaud <yves.brissaud@gmail.com>
1 parent cc29f28 commit 9ef74c5

File tree

3 files changed

+50
-26
lines changed

3 files changed

+50
-26
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
# `docker run`, better
22

3+
```text
4+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⢴⡶⡶⡶⣶⢶⣦⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
5+
⠀⠀⠀⠀⠀⠀⠀⢀⣤⡈⠩⣉⣁⠁⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠻⢵⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
6+
⠀⠀⠀⠀⠀⣠⢾⠛⠉⠀⠀⠈⣛⡟⢷⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠻⡷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
7+
⠀⠀⠀⢠⣞⠏⠁⠀⠀⠀⠀⠠⣒⠯⣗⢮⣚⢷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀
8+
⠀⠀⣰⡯⠁⠀⠀⠀⠀⣀⣰⢽⠲⠝⢎⣛⣊⣋⣓⣛⣂⣀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⠄⠀⠀⠀⠀⠀⣀⡀
9+
⠀⣰⡟⠀⠀⠀⢀⠤⠌⣃⣭⢶⣞⣿⣽⣾⣻⣽⣯⢿⣽⡯⠿⠶⣶⢦⣤⣤⠤⣤⣤⣤⠴⠶⠒⠚⠉⠉⠀⠀
10+
⢠⡿⠀⠀⠀⠐⣩⣶⣻⣽⡾⠿⠙⠓⠉⠈⠁⠀⣯⠀⠀⠀⠘⢓⣠⣴⣖⣛⣉⡡⠀⠀⠰⣾⠀⠀⠀⠀⠀⠀
11+
⣸⡇⠀⠀⣠⣾⣟⠞⠋⠁⣀⣠⣤⣴⣶⡶⡦⠀⠻⣄⣀⠀⢨⣤⣤⠴⠖⠋⠁⠀⠀⠀⠀⡿⡆⠀⠀⠀⠀⠀
12+
⣿⡅⠀⢰⣟⠇⠁⠤⠒⠉⠉⠀⣀⣀⣤⣤⣤⢶⠶⠞⠛⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⡇⠀⠀⠀⠀⠀
13+
⣷⡇⠀⣟⠃⠀⠀⢀⣠⡴⠞⠛⠉⠉⣰⡟⣠⠟⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⡇⠀⠀⠀⠀⠀
14+
⢸⣇⠀⢻⡀⠀⣰⢻⡁⠀⠀⠀⡠⠞⠉⠐⠁⠀⠀⠀⣠⡶⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢿⠃⠀⠀⠀⠀⠀
15+
⠈⣷⡄⠘⢧⡀⠏⠘⢷⣄⣀⠀⠀⠀⠀⠀⠀⠀⣠⣾⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠀⠀⠀⠀⠀⠀
16+
⠀⠘⣷⡄⠈⠳⣄⡀⠀⠙⠿⣻⣅⡀⠀⠀⢀⣼⢿⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠿⠀⠀⠀⠀⠀⠀⠀
17+
⠀⠀⠈⢟⣦⠀⢻⠻⠶⢤⣄⣀⠉⠛⠳⠶⣞⣿⣽⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠟⠁⠀⠀⠀⠀⠀⠀⠀
18+
⠀⠀⠀⠀⠙⢷⣄⡀⠀⠀⠙⠏⠙⠛⠓⠲⣶⣖⡏⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⡽⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀
19+
⠀⠀⠀⠀⠀⠀⠙⠻⣦⣄⡀⠀⠀⠀⠀⠀⣷⢿⡅⠀⠀⠀⠀⠀⢀⣠⣴⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
20+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠙⠷⣶⣤⣤⣄⠸⣟⣷⠠⣤⣤⡶⠾⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
21+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠉⠀⠹⣽⡄⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
22+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
23+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
24+
```
25+
326
See the [Docker RunX reference](/docs/reference/runx.md) for more information.

internal/commands/version/version.go

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,28 @@ func NewCmd(_ command.Cli) *cobra.Command {
1414
Use: "version",
1515
Short: "Show Docker RunX version information",
1616
Run: func(_ *cobra.Command, _ []string) {
17-
fmt.Println(constants.Short())
17+
fmt.Println(`
18+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⢴⡶⡶⡶⣶⢶⣦⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
19+
⠀⠀⠀⠀⠀⠀⠀⢀⣤⡈⠩⣉⣁⠁⠀⠀⠀⠀⠀⠀⠀⠈⠉⠙⠻⢵⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
20+
⠀⠀⠀⠀⠀⣠⢾⠛⠉⠀⠀⠈⣛⡟⢷⣦⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠻⡷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
21+
⠀⠀⠀⢠⣞⠏⠁⠀⠀⠀⠀⠠⣒⠯⣗⢮⣚⢷⣦⡀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠻⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀
22+
⠀⠀⣰⡯⠁⠀⠀⠀⠀⣀⣰⢽⠲⠝⢎⣛⣊⣋⣓⣛⣂⣀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢿⠄⠀⠀⠀⠀⠀⣀⡀ __________ Docker ____ ___
23+
⠀⣰⡟⠀⠀⠀⢀⠤⠌⣃⣭⢶⣞⣿⣽⣾⣻⣽⣯⢿⣽⡯⠿⠶⣶⢦⣤⣤⠤⣤⣤⣤⠴⠶⠒⠚⠉⠉⠀⠀ \______ \__ __ ____ \ \/ /
24+
⢠⡿⠀⠀⠀⠐⣩⣶⣻⣽⡾⠿⠙⠓⠉⠈⠁⠀⣯⠀⠀⠀⠘⢓⣠⣴⣖⣛⣉⡡⠀⠀⠰⣾⠀⠀⠀ | _/ | \/ \ \ /
25+
⣸⡇⠀⠀⣠⣾⣟⠞⠋⠁⣀⣠⣤⣴⣶⡶⡦⠀⠻⣄⣀⠀⢨⣤⣤⠴⠖⠋⠁⠀⠀⠀⠀⡿⡆⠀⠀⠀⠀⠀ | | \ | / | \/ \
26+
⣿⡅⠀⢰⣟⠇⠁⠤⠒⠉⠉⠀⣀⣀⣤⣤⣤⢶⠶⠞⠛⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⡇⠀⠀⠀⠀⠀ |____|_ /____/|___| /___/\ \
27+
⣷⡇⠀⣟⠃⠀⠀⢀⣠⡴⠞⠛⠉⠉⣰⡟⣠⠟⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡿⡇⠀⠀⠀⠀⠀ \/ \/ \_/
28+
⢸⣇⠀⢻⡀⠀⣰⢻⡁⠀⠀⠀⡠⠞⠉⠐⠁⠀⠀⠀⣠⡶⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢿⠃⠀⠀⠀⠀⠀
29+
⠈⣷⡄⠘⢧⡀⠏⠘⢷⣄⣀⠀⠀⠀⠀⠀⠀⠀⣠⣾⠏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⡟⠀⠀⠀⠀⠀⠀
30+
⠀⠘⣷⡄⠈⠳⣄⡀⠀⠙⠿⣻⣅⡀⠀⠀⢀⣼⢿⡞⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠿⠀⠀⠀⠀⠀⠀⠀
31+
⠀⠀⠈⢟⣦⠀⢻⠻⠶⢤⣄⣀⠉⠛⠳⠶⣞⣿⣽⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠟⠁⠀⠀⠀⠀⠀⠀⠀
32+
⠀⠀⠀⠀⠙⢷⣄⡀⠀⠀⠙⠏⠙⠛⠓⠲⣶⣖⡏⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⡽⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀
33+
⠀⠀⠀⠀⠀⠀⠙⠻⣦⣄⡀⠀⠀⠀⠀⠀⣷⢿⡅⠀⠀⠀⠀⠀⢀⣠⣴⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
34+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠙⠷⣶⣤⣤⣄⠸⣟⣷⠠⣤⣤⡶⠾⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
35+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠉⠀⠹⣽⡄⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
36+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
37+
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀`)
38+
fmt.Printf("version: v%s (%s)\ngit commit:%s\n", constants.Version, constants.Runtime(), constants.Revision)
1839
},
1940
}
2041

internal/constants/constants.go

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
44
"fmt"
55
"runtime"
66
"runtime/debug"
7-
"strings"
8-
"time"
97
)
108

119
const (
@@ -19,11 +17,9 @@ const (
1917
)
2018

2119
var (
22-
Version string = "(devel)"
23-
Revision string
24-
LastCommit time.Time
25-
DirtyBuild bool
26-
UserAgent string
20+
Version string = "(devel)"
21+
Revision string
22+
UserAgent string
2723
)
2824

2925
func init() {
@@ -35,29 +31,13 @@ func init() {
3531
switch setting.Key {
3632
case "vcs.revision":
3733
Revision = setting.Value
38-
case "vcs.time":
39-
LastCommit, _ = time.Parse(time.RFC3339, setting.Value)
40-
case "vcs.modified":
41-
DirtyBuild = setting.Value == "true"
4234
}
4335
}
4436
}
4537

4638
UserAgent = fmt.Sprintf("%s/%s go/%s git-commit/%s", BinaryName, Version, runtime.Version(), Revision)
4739
}
4840

49-
func Short() string {
50-
parts := make([]string, 0, 3)
51-
parts = append(parts, Version)
52-
if Revision != "unknown" && Revision != "" {
53-
commit := Revision
54-
if len(commit) > 7 {
55-
commit = commit[:7]
56-
}
57-
parts = append(parts, commit)
58-
if DirtyBuild {
59-
parts = append(parts, "dirty")
60-
}
61-
}
62-
return strings.Join(parts, "-")
41+
func Runtime() string {
42+
return fmt.Sprintf("%s - %s/%s", runtime.Version(), runtime.GOOS, runtime.GOARCH)
6343
}

0 commit comments

Comments
 (0)