Make the short git hash length a configuration parameter, and default it
[arvados-dev.git] / arvados-version-server / usage.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package main
6
7 import (
8         "flag"
9         "fmt"
10         "os"
11 )
12
13 var exampleConfigFile = []byte(`
14 dirPath: "/tmp/arvados-version-server-checkout"
15 cacheDirPath: "/tmp/arvados-version-server-cache"
16 gitExecutablePath: "/usr/bin/git"
17 listenPort: 8080
18 shortHashLength: 7
19 `)
20
21 func usage(fs *flag.FlagSet) {
22         fmt.Fprintf(os.Stderr, `
23 Arvados Version Server is a JSON REST service that generates package version
24 numbers for a given git commit hash.
25
26 Options:
27 `)
28         fs.PrintDefaults()
29         fmt.Fprintf(os.Stderr, `
30 Example config file:
31 %s
32 `, exampleConfigFile)
33 }