Add Debian package building, add manpage, release v1.0.0
This commit is contained in:
@@ -20,6 +20,9 @@ import (
|
||||
"git.ipng.ch/ipng/s3-genindex/internal/indexgen"
|
||||
)
|
||||
|
||||
// Version is the application version (sync'd from debian/changelog)
|
||||
const Version = "1.0.0-1"
|
||||
|
||||
// S3Config holds S3 connection configuration
|
||||
type S3Config struct {
|
||||
Endpoint string
|
||||
@@ -348,6 +351,7 @@ func main() {
|
||||
var dryRun bool
|
||||
var showIndexFiles bool
|
||||
var watermarkURL string
|
||||
var showVersion bool
|
||||
|
||||
// Set defaults
|
||||
opts.DirAppend = true
|
||||
@@ -363,6 +367,7 @@ func main() {
|
||||
flag.BoolVar(&opts.Verbose, "v", false, "verbosely list every processed file")
|
||||
flag.BoolVar(&showIndexFiles, "i", false, "show index.html files in directory listings")
|
||||
flag.StringVar(&watermarkURL, "wm", "", "watermark logo URL to display in top left corner")
|
||||
flag.BoolVar(&showVersion, "version", false, "show version information")
|
||||
|
||||
flag.Usage = func() {
|
||||
fmt.Fprintf(os.Stderr, "Generate directory index files (recursive is ON, hidden files included by default).\n")
|
||||
@@ -381,6 +386,12 @@ func main() {
|
||||
|
||||
flag.Parse()
|
||||
|
||||
// Handle version flag
|
||||
if showVersion {
|
||||
fmt.Printf("s3-genindex version %s\n", Version)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
// Check mutual exclusion and that exactly one option is provided
|
||||
if directory == "" && s3URL == "" {
|
||||
fmt.Fprintf(os.Stderr, "Error: Either -d <directory> or -s3 <url> must be specified.\n\n")
|
||||
|
||||
Reference in New Issue
Block a user