aboutsummaryrefslogtreecommitdiffstats
path: root/dec.go
diff options
context:
space:
mode:
Diffstat (limited to 'dec.go')
-rw-r--r--dec.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/dec.go b/dec.go
index e67f4b3..d1404b7 100644
--- a/dec.go
+++ b/dec.go
@@ -22,6 +22,23 @@ type decryptFlags struct {
func (f *decryptFlags) registerFlags(fs *flag.FlagSet) {
fs.StringVar(&f.password, "p", "", "use the specified password; if not provided, dec will prompt for a password")
fs.BoolVar(&f.force, "f", false, "overwrite output files even if they already exist")
+ fs.Usage = func() {
+ fmt.Fprintf(fs.Output(), `usage: %s [OPTION]... [FILE]...
+Decrypt files, or stdin if no files are provided.
+
+`,
+ fs.Name())
+ fs.PrintDefaults()
+ fmt.Fprintf(fs.Output(), `-p is required when reading from stdin.
+
+For example,
+ %s my-encrypted-file.txt.enc
+would decrypt my-encrypted-file.txt.enc and write the result to
+my-encrypted-file.txt. If a filename does not end with .enc, the name
+will be appended with a .dec extension.
+`,
+ fs.Name())
+ }
}
type decryptOptions struct {