Alias 'ipfs --version' to 'ipfs version'
License: MIT Signed-off-by: Chris Sasarak <chris.sasarak@gmail.com>
Chris Sasarak committed
Jul 25, 2016 at 21:49 UTC
b59e271047fb6e1a5bfcc5b02441907aa11d9882
1 file changed
+7
-3
cmd/ipfs/main.go
+7
-3
@@ -103,9 +103,13 @@ func main() {
103
}
104
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
+ }
113
}
114
115
// parse the commandline into a command invocation