grim/reap
Clone
Summary
Browse
Changes
Graph
Lots of work involving the config file and includes and a graphviz command to show the dependency graph
draft
2021-03-17, Gary Kramlich
ade26f3045b2
Lots of work involving the config file and includes and a graphviz command to show the dependency graph
package
main
import
(
"github.com/alecthomas/kong"
"keep.imfreedom.org/grim/reap/consts"
"keep.imfreedom.org/grim/reap/globals"
"keep.imfreedom.org/grim/reap/graphviz"
"keep.imfreedom.org/grim/reap/version"
)
type
cli
struct
{
globals
.
Globals
Graphviz
graphviz
.
Cmd
`kong:"cmd,help='Output the dependency graph in graphviz format'"`
Version
version
.
Cmd
`kong:"cmd,help='Display the version number and exit'"`
}
func
main
()
{
cli
:=
cli
{}
ctx
:=
kong
.
Parse
(
&
cli
,
kong
.
Name
(
consts
.
Name
),
kong
.
Description
(
consts
.
Description
),
kong
.
UsageOnError
(),
)
err
:=
ctx
.
Run
(
&
cli
.
Globals
)
ctx
.
FatalIfErrorf
(
err
)
}