Revert "Clean up"

This reverts commit 201c69e414.
This commit is contained in:
Jeroen Bobbeldijk
2017-09-17 10:48:17 +02:00
parent 411accf30f
commit 515058212d

12
sign.go
View File

@@ -20,12 +20,12 @@ import (
// usage is a usage function for the flags package.
func usage() {
fmt.Fprintf(os.Stderr, "Pdfsign is a tool to sign and verify PDF digital signatures\n\n")
fmt.Fprintf(os.Stderr, "Pdfsign is a tool to sign and verifyPDF PDF digital signatures\n\n")
fmt.Fprintf(os.Stderr, "Usage:\n\n")
fmt.Fprintf(os.Stderr, "\tpdfsign command [arguments]\n\n")
fmt.Fprintf(os.Stderr, "The commands are:\n\n")
fmt.Fprintf(os.Stderr, "\tsign \t\tsign single PDF document\n")
fmt.Fprintf(os.Stderr, "\tverify \t\tverify signature of single PDF document\n")
fmt.Fprintf(os.Stderr, "\tverifyPDF \t\tverifyPDF signature of single PDF document\n")
fmt.Fprintf(os.Stderr, "\tserve \t\tserve web API with signing capabilities. API documentation url\n")
fmt.Fprintf(os.Stderr, "\twatch \t\tautomatically sign PDF files inside a folder\n")
fmt.Fprintf(os.Stderr, "\n\n")
@@ -43,7 +43,7 @@ func main() {
switch os.Args[1] {
case "sign":
simpleSign()
case "verify":
case "verifyPDF":
verifyPDF()
case "serve":
case "watch":
@@ -54,7 +54,7 @@ func main() {
}
func verifyPDF() {
verifyCommand := flag.NewFlagSet("verify", flag.ExitOnError)
verifyCommand := flag.NewFlagSet("verifyPDF", flag.ExitOnError)
input := verifyCommand.String("in", "", "")
input_file, err := os.Open(*input)
@@ -139,7 +139,7 @@ func p11sign() {
//}
//
//method := flag.Arg(0)
//if method != "sign" && method != "verify" {
//if method != "sign" && method != "verifyPDF" {
// usage()
//}
//
@@ -148,7 +148,7 @@ func p11sign() {
// usage()
//}
//
//if method == "verify" {
//if method == "verifyPDF" {
// input_file, err := os.Open(input)
// if err != nil {
// log.Fatal(err)