Skip to content

Instantly share code, notes, and snippets.

@ludomikula
Created September 26, 2019 10:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludomikula/e149cbb14f68c5d2b38cc0b7b148c029 to your computer and use it in GitHub Desktop.
Save ludomikula/e149cbb14f68c5d2b38cc0b7b148c029 to your computer and use it in GitHub Desktop.
diff --git a/cmd/restic/main.go b/cmd/restic/main.go
index e61547c5..f9e8cfaa 100644
--- a/cmd/restic/main.go
+++ b/cmd/restic/main.go
@@ -1,5 +1,7 @@
package main
+import "C"
+
import (
"bufio"
"bytes"
@@ -109,3 +111,13 @@ func main() {
Exit(exitCode)
}
+
+//export run
+func run(args []string) (success bool) {
+ cmdRoot.SetArgs(args)
+ err := cmdRoot.Execute()
+ if err != nil {
+ return false
+ }
+ return true
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment