aboutsummaryrefslogtreecommitdiffstats
path: root/enc.go
diff options
context:
space:
mode:
Diffstat (limited to 'enc.go')
-rw-r--r--enc.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/enc.go b/enc.go
index 1217606..fc54756 100644
--- a/enc.go
+++ b/enc.go
@@ -23,6 +23,21 @@ func (f *encryptFlags) registerFlags(fs *flag.FlagSet) {
fs.BoolVar(&f.generatePassword, "g", false, "generate a secure password automatically (password will be printed to stderr)")
fs.StringVar(&f.password, "p", "", "use the specified password; if not provided, enc 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]...
+Encrypt files, or stdin if no files are provided.
+
+`,
+ fs.Name())
+ fs.PrintDefaults()
+ fmt.Fprintf(fs.Output(), `
+One of -g or -p must be used when reading from stdin. When encrypting to
+stdout, consider redirecting the result since binary output can mess up
+your terminal. Example:
+ echo test | %s -p 'my super secure password' | base64
+`,
+ fs.Name())
+ }
}
type encryptOptions struct {