Update USAGE.txt

Also run go fmt
This commit is contained in:
Jakob Unterwurzacher 2015-11-03 00:06:04 +01:00
parent de56fe9e35
commit 1ec0fa388d
3 changed files with 12 additions and 9 deletions

View File

@ -16,6 +16,8 @@ Options:
Use OpenSSL instead of built-in Go crypto (default true)
-passwd
Change password
-plaintextnames
Do not encrypt file names - can only be used together with -init
-version
Print version and exit
-zerokey

View File

@ -22,7 +22,7 @@ type CryptFS struct {
plainBS uint64
cipherBS uint64
// Stores an all-zero block of size cipherBS
allZeroBlock []byte
allZeroBlock []byte
plaintextNames bool
}
@ -50,11 +50,11 @@ func NewCryptFS(key []byte, useOpenssl bool, plaintextNames bool) *CryptFS {
cipherBS := DEFAULT_PLAINBS + NONCE_LEN + AUTH_TAG_LEN
return &CryptFS{
blockCipher: b,
gcm: gcm,
plainBS: DEFAULT_PLAINBS,
cipherBS: uint64(cipherBS),
allZeroBlock: make([]byte, cipherBS),
blockCipher: b,
gcm: gcm,
plainBS: DEFAULT_PLAINBS,
cipherBS: uint64(cipherBS),
allZeroBlock: make([]byte, cipherBS),
plaintextNames: plaintextNames,
}
}

View File

@ -58,8 +58,8 @@ func initDir(dirArg string, plaintextNames bool) {
}
func usageText() {
fmt.Printf("Usage: %s [OPTIONS] CIPHERDIR MOUNTPOINT\n", PROGRAM_NAME)
fmt.Printf("\nOptions:\n")
fmt.Fprintf(os.Stderr, "Usage: %s [OPTIONS] CIPHERDIR MOUNTPOINT\n", PROGRAM_NAME)
fmt.Fprintf(os.Stderr, "\nOptions:\n")
flag.PrintDefaults()
}
@ -83,7 +83,8 @@ func main() {
flag.BoolVar(&args.passwd, "passwd", false, "Change password")
flag.BoolVar(&args.foreground, "f", false, "Stay in the foreground")
flag.BoolVar(&args.version, "version", false, "Print version and exit")
flag.BoolVar(&args.plaintextnames, "plaintextnames", false, "Do not encrypt file names")
flag.BoolVar(&args.plaintextnames, "plaintextnames", false,
"Do not encrypt file names - can only be used together with -init")
flag.StringVar(&args.masterkey, "masterkey", "", "Mount with explicit master key")
args.cpuprofile = flag.String("cpuprofile", "", "Write cpu profile to specified file")