aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ejson/10-patch1.patch
blob: baafd256de90984b20318d1d08ae8b58ef7edf3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- ejson/cmd/ejson/main.go.orig	2017-04-06 19:25:23.711948831 +0000
+++ ejson/cmd/ejson/main.go	2017-04-06 19:25:41.585791634 +0000
@@ -4,33 +4,15 @@ import (
 	"fmt"
 	"os"
 	"runtime"
-	"syscall"
 
 	"github.com/codegangsta/cli"
 )
 
-func execManpage(sec, page string) {
-	if err := syscall.Exec("/usr/bin/env", []string{"/usr/bin/env", "man", sec, page}, os.Environ()); err != nil {
-		fmt.Println("Exec error:", err)
-	}
-	os.Exit(1)
-}
 
 func main() {
 	// Encryption is expensive. We'd rather burn cycles on many cores than wait.
 	runtime.GOMAXPROCS(runtime.NumCPU())
 
-	// Rather than using the built-in help printer, display the bundled manpages.
-	cli.HelpPrinter = func(templ string, data interface{}) {
-		if cmd, ok := data.(cli.Command); ok {
-			switch cmd.Name {
-			case "encrypt", "decrypt", "keygen":
-				execManpage("1", "ejson-"+cmd.Name)
-			}
-		}
-		execManpage("1", "ejson")
-	}
-
 	app := cli.NewApp()
 	app.Flags = []cli.Flag{
 		cli.StringFlag{