Skip to content

Commit

Permalink
Moved MPCL documentation generation to its own application.
Browse files Browse the repository at this point in the history
  • Loading branch information
markkurossi committed Sep 29, 2023
1 parent a4cb8d6 commit a7d9f09
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ apps/circuit/circuit
apps/garbled/garbled
apps/ot/ot
apps/iter/iter
apps/mpcldoc/mpcldoc
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ all:

apidoc:
$(BLOG)/blog -site -lib $(BLOG) -draft -t templates/mpcl -o $(OUTPUT) docs/apidoc/
./apps/garbled/garbled -doc $(OUTPUT) pkg
./apps/mpcldoc/mpcldoc -dir $(OUTPUT) pkg

public:
make apidoc OUTPUT=$(HOME)/work/www/mpcl
16 changes: 0 additions & 16 deletions apps/garbled/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ func main() {
memprofile := flag.String("memprofile", "",
"write memory profile to `file`")
bmr := flag.Int("bmr", -1, "semi-honest secure BMR protocol player number")
doc := flag.String("doc", "",
"generate documentation about files to the argument directory")
objdump := flag.Bool("objdump", false, "print information about objects")
testIO := flag.Int64("test-io", 0, "test I/O performance")
flag.Parse()
Expand Down Expand Up @@ -118,20 +116,6 @@ func main() {
return
}

if len(*doc) > 0 {
if len(flag.Args()) == 0 {
fmt.Printf("no files specified\n")
os.Exit(1)
}
doc, err := NewHTMLDoc(*doc)
if err != nil {
log.Fatal(err)
}
if err := documentation(flag.Args(), doc); err != nil {
log.Fatal(err)
}
return
}
if *testIO > 0 {
if *evaluator {
err := evaluatorTestIO(*testIO, len(*cpuprofile) > 0)
Expand Down
File renamed without changes.
File renamed without changes.
38 changes: 38 additions & 0 deletions apps/mpcldoc/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// main.go
//
// Copyright (c) 2019-2023 Markku Rossi
//
// All rights reserved.
//

package main

import (
"flag"
"fmt"
"log"
"os"
)

func main() {
dir := flag.String("dir", ",apidoc",
"generate documentation to the argument directory")
flag.Parse()

log.SetFlags(0)

if len(flag.Args()) == 0 {
fmt.Println("no files specified")
os.Exit(1)
}

doc, err := NewHTMLDoc(*dir)
if err != nil {
log.Fatal(err)
}
err = documentation(flag.Args(), doc)
if err != nil {
log.Fatal(err)
}
}

0 comments on commit a7d9f09

Please sign in to comment.