-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
47 lines (41 loc) · 1.3 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2018 A Bit of Help, Inc. - All Rights Reserved, Worldwide.
// Use of this source code is governed by a MIT license that can be found in the LICENSE file.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Package main contains the entry point to the application and configuration settings.
package main
import (
"fmt"
. "github.com/abitofhelp/go-helpers/error"
"github.com/abitofhelp/pipeline/cmd"
"gopkg.in/urfave/cli.v2"
"os"
)
const (
kApplicationFailure = 0
kApplicationSuccess = 1
)
// Function main is the entry point to the application.
func main() {
app := &cli.App{
Name: "pipeline",
Usage: "Scans a directory path for image files and injects them into a pipeline for processing.",
Commands: []*cli.Command{
&cmd.Start,
},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "debug",
Usage: "enables debug logging",
},
},
}
err := app.Run(os.Args)
if IsError(err, func(err error) {
fmt.Printf("The application encountered an error: %v", err)
os.Exit(kApplicationFailure)
}) {
fmt.Println("The application has completed successfully.")
os.Exit(kApplicationSuccess)
}
}