From 022dad64e704cc3b064e220ae9b271d2f708d11e Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 11 Apr 2023 14:14:54 -0400 Subject: [PATCH] main: simple Usage description and add a go modules file Signed-off-by: Vincent Batts --- go.mod | 3 +++ main.go | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8f3fd09 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/vbatts/dedupe-linker + +go 1.20 diff --git a/main.go b/main.go index 6faf978..75f7da7 100644 --- a/main.go +++ b/main.go @@ -32,6 +32,12 @@ func init() { if os.Getenv("VARBASEDIR") != "" { varBaseDir = filepath.Clean(os.Getenv("VARBASEDIR")) } + + flag.Usage = func() { + fmt.Fprintf(flag.CommandLine.Output(), "Usage of %s:\n", os.Args[0]) + fmt.Fprintf(flag.CommandLine.Output(), "\nThis app will make hardlinks of a directory tree, to a content addressible collection in the 'basedir'\n\n") + flag.PrintDefaults() + } } func main() {