summaryrefslogtreecommitdiff
path: root/man/data.go
diff options
context:
space:
mode:
Diffstat (limited to 'man/data.go')
-rw-r--r--man/data.go43
1 files changed, 0 insertions, 43 deletions
diff --git a/man/data.go b/man/data.go
deleted file mode 100644
index 322da8f..0000000
--- a/man/data.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package main
-
-import (
- _ "embed"
- _ "github.com/ewy1/pik/flags"
- "github.com/ewy1/pik/spool"
- "github.com/spf13/pflag"
- "runtime"
- "runtime/debug"
- "time"
-)
-
-//go:embed version.txt
-var version string
-
-type ManData struct {
- Flags []pflag.Flag
- Now string
- Revision string
- Runtime string
- Version string
- ExitCodes map[int]*spool.ExitCode
-}
-
-func NewData() ManData {
- var flags []pflag.Flag
- pflag.Parse()
- pflag.VisitAll(func(flag *pflag.Flag) {
- flags = append(flags, *flag)
- })
- info, ok := debug.ReadBuildInfo()
- if !ok {
- _, _ = spool.Panic(spool.NoDebugInfo, "could not read debug info\n")
- }
- return ManData{
- Flags: flags,
- Now: time.Now().Format(time.DateTime),
- Runtime: runtime.Version(),
- Version: version,
- Revision: info.Main.Version,
- ExitCodes: spool.CodeMap,
- }
-}