mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-01 03:14:02 +03:00
a92b9abf34
* implementation work for json importers * json driver checkpoint * working on json.ParseObjectsInArray * json.ParseObjectsInArray seems to be working * checkpoint while tidying up ParseObjectsInArray * more tidy checkpoint * more tidy checkpoint 2 * tidying up ParseObjectsInArray * tidy up * code/docs cleanup * more cleanup of json driver * more cleanup of json driver * flat json import seemingly working * improvements to json driver * json writer now prints empty [] for postgres empty tables
30 lines
458 B
Go
30 lines
458 B
Go
// Package main contains sq's main function.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"os/signal"
|
|
|
|
"github.com/neilotoole/sq/cli"
|
|
)
|
|
|
|
func main() {
|
|
ctx, cancelFn := context.WithCancel(context.Background())
|
|
defer cancelFn()
|
|
|
|
go func() {
|
|
stopCh := make(chan os.Signal, 1)
|
|
signal.Notify(stopCh, os.Interrupt)
|
|
|
|
<-stopCh
|
|
cancelFn()
|
|
}()
|
|
|
|
err := cli.Execute(ctx, os.Stdin, os.Stdout, os.Stderr, os.Args)
|
|
if err != nil {
|
|
cancelFn()
|
|
os.Exit(1)
|
|
}
|
|
}
|