File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,13 @@ func main() {
103
103
}
104
104
105
105
// Handle `ipfs help'
106
- if len (os .Args ) == 2 && os .Args [1 ] == "help" {
107
- printHelp (false , os .Stdout )
108
- os .Exit (0 )
106
+ if len (os .Args ) == 2 {
107
+ if os .Args [1 ] == "help" {
108
+ printHelp (false , os .Stdout )
109
+ os .Exit (0 )
110
+ } else if os .Args [1 ] == "--version" {
111
+ os .Args [1 ] = "version"
112
+ }
109
113
}
110
114
111
115
// parse the commandline into a command invocation
Original file line number Diff line number Diff line change @@ -16,11 +16,24 @@ test_expect_success "ipfs version succeeds" '
16
16
ipfs version >version.txt
17
17
'
18
18
19
+ test_expect_success " ipfs --version success" '
20
+ ipfs --version ||
21
+ test_fsh ipfs --version
22
+ '
23
+
19
24
test_expect_success " ipfs version output looks good" '
20
25
egrep "^ipfs version [0-9]+\.[0-9]+\.[0-9]" version.txt >/dev/null ||
21
26
test_fsh cat version.txt
22
27
'
23
28
29
+ test_expect_success " ipfs versions matches ipfs --version" '
30
+ ipfs version > version.txt &&
31
+ ipfs --version > version2.txt &&
32
+ diff version2.txt version.txt ||
33
+ test_fsh ipfs --version
34
+
35
+ '
36
+
24
37
test_expect_success " ipfs version --all has all required fields" '
25
38
ipfs version --all > version_all.txt &&
26
39
grep "go-ipfs version" version_all.txt &&
You can’t perform that action at this time.
0 commit comments