wip: initial commit

Extremely unfinished and work in progress.
This commit is contained in:
2022-09-07 08:37:01 +01:00
commit b0e52fc498
13 changed files with 809 additions and 0 deletions

36
main.go Normal file
View File

@@ -0,0 +1,36 @@
package main
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/jimeh/mj2n/commands"
)
func main() {
cmd, err := commands.NewMJ2N()
if err != nil {
fatal(err)
}
ctx, cancel := signal.NotifyContext(
context.Background(),
syscall.SIGINT, syscall.SIGTERM,
)
defer cancel()
err = cmd.ExecuteContext(ctx)
if err != nil {
defer os.Exit(1)
return
}
}
func fatal(err error) {
fmt.Fprintf(os.Stderr, "ERROR: %s\n", err)
os.Exit(1)
}