/
arguments.go
52 lines (41 loc) · 2.41 KB
/
arguments.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
48
49
50
51
52
package main
import (
"flag"
"github.com/logrusorgru/aurora"
"io/ioutil"
"log"
"os"
)
var compressHtmlFlag = flag.Bool("compress_web", false, "compress web related files: html/htm/js/css/xml/json/wasm (disabled by default)")
var standaloneFiles = flag.Bool("standalone_files", true, "when disabled ead creates metadata and depends on auxiliary files/structures. When enabled it generates more portable/standalone variant of the data without the extra metadata and without auxiliary helpers")
var timestampFlag = flag.Bool("timestamped_log", true, "enable logger's timestamps")
var colorsFlag = flag.Bool("colors", false, "enable logger's colors (disabled by default)")
var outputAuxiliaryFlag = flag.Bool("output_auxiliary", true, "output miscalenialous supporting files, not just raw data")
var sourceDirFlag = flag.String("source", "", "source directory where the binary files will be fetch from (when the source_current_folder is set true then by default it's the current working directory"+SLASHES_HELP+")")
var sourceCurrentFlag = flag.Bool("source_current_folder", false, "allow to use the curent working directory as your source (disabled by default)")
var outputDirFlag = flag.String("output", "", "output directory where the C and H files will be saved to (by default it's the parent directory of the sourceDir"+SLASHES_HELP+")")
var outputContainerFlag = flag.String("output_container", "data_root_include", "Under what container folder inside the output directory will the data-only part be stored")
var customCopyrightFlag = flag.String("copyright", "", "path to your own copyright notice file (by default Microchip's copyright is used)")
var hexDumpFoarmatingFlag = flag.Bool("hexdump_format", true, "should be the hex dump be formated into chucks of 4 bytes")
var includePrefixFlag = flag.String("include_prefix", "embedded_autogenerated_data", "prefix added to the path in the include statements")
var sourceDir string
var outputDir string
var au aurora.Aurora
func init() {
versionFlag := flag.Bool("v", false, "prints current version")
quietFlag := flag.Bool("quiet", false, "do not print log messages (by default logger is noisy)")
flag.Parse()
au = aurora.NewAurora(*colorsFlag)
log.SetOutput(os.Stdout)
if *timestampFlag {
log.SetFlags(log.Ldate | log.Ltime)
}
if *versionFlag {
log.Println("EAD tool version", au.Bold(EAD_VERSION))
os.Exit(0)
}
if *quietFlag {
log.SetOutput(ioutil.Discard)
log.SetFlags(0)
}
}