-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (27 loc) · 904 Bytes
/
main.go
File metadata and controls
35 lines (27 loc) · 904 Bytes
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
// SPDX-FileCopyrightText: 2025 The Cipher Host Team <team@cipher.host>
//
// SPDX-License-Identifier: EUPL-1.2
package main // import "go.cipher.host/pkgdex"
import (
"os"
"go.cipher.host/cmdkit"
"go.cipher.host/pkgdex/internal/app"
"go.cipher.host/pkgdex/internal/meta"
)
func main() {
cli := cmdkit.New(meta.Name, meta.Description, meta.Version)
cli.AddCommand(app.NewStartCommand())
cli.AddCommand(app.NewStopCommand())
cli.AddCommand(app.NewGenerateKeyCommand())
cli.AddCommand(app.NewGenerateUsageCommand())
cli.Examples = []string{
meta.Name + " start --config '/etc/pkgdex/config.json'",
meta.Name + " stop --config '/etc/pkgdex/config.json'",
meta.Name + " generate-key > '/etc/pkgdex/credential/pkgdex-key'",
meta.Name + " generate-usage '/path/to/example.go'",
}
if err := cli.Run(os.Args[1:]); err != nil {
cli.Errorf("error: %v\n", err)
cmdkit.Exit(err)
}
}