From: Sergey Matveev Date: Wed, 25 Mar 2026 10:06:28 +0000 (+0300) Subject: detpax -version/-warranty X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=01e733fd577706afe55e83936c44c73ad1df4cb728da77e10e7975de4b84bbb6;p=bass.git detpax -version/-warranty --- diff --git a/build/contrib/detpax/main.go b/build/contrib/detpax/main.go index 833e618..11b0015 100644 --- a/build/contrib/detpax/main.go +++ b/build/contrib/detpax/main.go @@ -23,6 +23,7 @@ import ( "io/fs" "log" "os" + "runtime" "sort" "strings" "syscall" @@ -30,6 +31,7 @@ import ( ) const ( + Version = "0.1.0" SkelpkgPrefix = "skelpkg" DefBufSize = 1 << 20 OrderForLinks = 1<<31 - 1 @@ -113,6 +115,8 @@ func walk( } func main() { + version := flag.Bool("version", false, "Print version") + warranty := flag.Bool("warranty", false, "Print warranty information") var precsOrig []string flag.Func("prec", "Add directory with higher precedence", func(s string) error { @@ -132,6 +136,26 @@ will put dir/foo/bar first, dir/foo second, others next.`) flag.PrintDefaults() } flag.Parse() + if *warranty { + fmt.Println(`Copyright (C) 2020-2026 Sergey Matveev + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see .`) + return + } + if *version { + fmt.Println("detpax", Version, "built with", runtime.Version()) + return + } var fd *os.File buf := make([]byte, DefBufSize) bw := bufio.NewWriterSize(os.Stdout, DefBufSize)