From af17b6a6f3d8f0d5df8f16a08a7d643308483a60 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Wed, 16 Feb 2022 11:08:26 +0100 Subject: [PATCH] Make copyright year dynamic --- cmd/step-awskms-init/main.go | 5 +++-- cmd/step-ca/main.go | 2 +- cmd/step-cloudkms-init/main.go | 5 +++-- cmd/step-pkcs11-init/main.go | 5 +++-- cmd/step-yubikey-init/main.go | 5 +++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cmd/step-awskms-init/main.go b/cmd/step-awskms-init/main.go index 8e30745f..5e56f045 100644 --- a/cmd/step-awskms-init/main.go +++ b/cmd/step-awskms-init/main.go @@ -75,10 +75,11 @@ This tool is experimental and in the future it will be integrated in step cli. OPTIONS`) fmt.Fprintln(os.Stderr) flag.PrintDefaults() - fmt.Fprintln(os.Stderr, ` + fmt.Fprintf(os.Stderr, ` COPYRIGHT - (c) 2018-2020 Smallstep Labs, Inc.`) + (c) 2018-%d Smallstep Labs, Inc. +`, time.Now().Year()) os.Exit(1) } diff --git a/cmd/step-ca/main.go b/cmd/step-ca/main.go index f40ddf5f..fba5b792 100644 --- a/cmd/step-ca/main.go +++ b/cmd/step-ca/main.go @@ -144,7 +144,7 @@ $ step-ca $STEPPATH/config/ca.json --password-file ./password.txt '''` app.Flags = append(app.Flags, commands.AppCommand.Flags...) app.Flags = append(app.Flags, cli.HelpFlag) - app.Copyright = "(c) 2018-2020 Smallstep Labs, Inc." + app.Copyright = fmt.Sprintf("(c) 2018-%d Smallstep Labs, Inc.", time.Now().Year()) // All non-successful output should be written to stderr app.Writer = os.Stdout diff --git a/cmd/step-cloudkms-init/main.go b/cmd/step-cloudkms-init/main.go index 27dc82ad..78c1fcc5 100644 --- a/cmd/step-cloudkms-init/main.go +++ b/cmd/step-cloudkms-init/main.go @@ -105,10 +105,11 @@ This tool is experimental and in the future it will be integrated in step cli. OPTIONS`) fmt.Fprintln(os.Stderr) flag.PrintDefaults() - fmt.Fprintln(os.Stderr, ` + fmt.Fprintf(os.Stderr, ` COPYRIGHT - (c) 2018-2020 Smallstep Labs, Inc.`) + (c) 2018-%d Smallstep Labs, Inc. +`, time.Now().Year()) os.Exit(1) } diff --git a/cmd/step-pkcs11-init/main.go b/cmd/step-pkcs11-init/main.go index 5fadf10d..4dc15799 100644 --- a/cmd/step-pkcs11-init/main.go +++ b/cmd/step-pkcs11-init/main.go @@ -250,10 +250,11 @@ This tool is experimental and in the future it will be integrated in step cli. OPTIONS`) fmt.Fprintln(os.Stderr) flag.PrintDefaults() - fmt.Fprintln(os.Stderr, ` + fmt.Fprintf(os.Stderr, ` COPYRIGHT - (c) 2018-2021 Smallstep Labs, Inc.`) + (c) 2018-%d Smallstep Labs, Inc. +`, time.Now().Year()) os.Exit(1) } diff --git a/cmd/step-yubikey-init/main.go b/cmd/step-yubikey-init/main.go index 8b0ffab5..9f755388 100644 --- a/cmd/step-yubikey-init/main.go +++ b/cmd/step-yubikey-init/main.go @@ -148,10 +148,11 @@ This tool is experimental and in the future it will be integrated in step cli. OPTIONS`) fmt.Fprintln(os.Stderr) flag.PrintDefaults() - fmt.Fprintln(os.Stderr, ` + fmt.Fprintf(os.Stderr, ` COPYRIGHT - (c) 2018-2020 Smallstep Labs, Inc.`) + (c) 2018-%d Smallstep Labs, Inc. +`, time.Now().Year()) os.Exit(1) }