2019-08-13 18:35:36 +00:00
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
import "os"
|
|
|
|
|
|
|
|
|
|
|
|
import "github.com/volution/kawipiko/cmd/server"
|
|
|
|
import "github.com/volution/kawipiko/cmd/archiver"
|
2022-09-02 10:59:46 +00:00
|
|
|
import "github.com/volution/kawipiko/cmd/version"
|
2019-08-13 18:35:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func main () () {
|
|
|
|
|
|
|
|
if len (os.Args) >= 2 {
|
|
|
|
|
|
|
|
_command := os.Args[1]
|
|
|
|
os.Args = os.Args[1:]
|
|
|
|
|
|
|
|
switch _command {
|
|
|
|
|
2022-09-02 10:59:46 +00:00
|
|
|
case "version", "--version", "-v" :
|
2022-09-02 12:27:11 +00:00
|
|
|
version.Main ("kawipiko-wrapper", "version")
|
|
|
|
return
|
|
|
|
|
|
|
|
case "--sources-md5" :
|
|
|
|
version.Main ("kawipiko-wrapper", "sources.md5")
|
|
|
|
return
|
|
|
|
|
|
|
|
case "--sources-cpio" :
|
|
|
|
version.Main ("kawipiko-wrapper", "sources.cpio")
|
|
|
|
return
|
2022-09-02 10:59:46 +00:00
|
|
|
|
2022-09-02 13:01:50 +00:00
|
|
|
case "--sbom-text", "--sbom-txt", "--sbom" :
|
|
|
|
version.Main ("kawipiko-wrapper", "sbom.txt")
|
|
|
|
return
|
|
|
|
|
|
|
|
case "--sbom-json" :
|
|
|
|
version.Main ("kawipiko-wrapper", "sbom.json")
|
|
|
|
return
|
|
|
|
|
2019-08-13 18:35:36 +00:00
|
|
|
case "server" :
|
|
|
|
server.Main ()
|
2022-09-02 12:27:11 +00:00
|
|
|
return
|
2019-08-13 18:35:36 +00:00
|
|
|
|
|
|
|
case "archiver" :
|
|
|
|
archiver.Main ()
|
2022-09-02 12:27:11 +00:00
|
|
|
return
|
2019-08-13 18:35:36 +00:00
|
|
|
|
|
|
|
default :
|
|
|
|
fmt.Fprintf (os.Stderr, "[!!] [44887671] unknown command: `%s`; aborting!\n", _command)
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2022-09-02 10:59:46 +00:00
|
|
|
fmt.Fprintf (os.Stderr, "[!!] [3628f38a] expected command: `server`, `archiver`, or `version`; aborting!\n")
|
2019-08-13 18:35:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|