From b527e205e231a7f0d5486b7593ba6b47cf09706d Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Tue, 1 Nov 2016 18:59:34 +0100 Subject: [PATCH] main: rename "-f" to "-fg" "-f" looks too much like "--force". The old variant is still accepted for compatability. --- Documentation/MANPAGE.md | 3 ++- cli_args.go | 5 +++-- daemonize.go | 2 +- main.go | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Documentation/MANPAGE.md b/Documentation/MANPAGE.md index 7478c76..2060786 100644 --- a/Documentation/MANPAGE.md +++ b/Documentation/MANPAGE.md @@ -56,8 +56,9 @@ Options: stripped by gocryptfs. Using something like "cat /mypassword.txt" allows to mount the gocryptfs filesytem without user interaction. -**-f** +**-fg, -f** : Stay in the foreground instead of forking away. Implies "-nosyslog". + For compatability, "-f" is also accepted, but "-fg" is preferred. **-fusedebug** : Enable fuse library debug output diff --git a/cli_args.go b/cli_args.go index ad65fef..358a6a9 100644 --- a/cli_args.go +++ b/cli_args.go @@ -14,7 +14,7 @@ import ( // argContainer stores the parsed CLI options and arguments type argContainer struct { - debug, init, zerokey, fusedebug, openssl, passwd, foreground, version, + debug, init, zerokey, fusedebug, openssl, passwd, fg, version, plaintextnames, quiet, nosyslog, wpanic, longnames, allow_other, ro, reverse, aessiv, nonempty, raw64 bool masterkey, mountpoint, cipherdir, cpuprofile, extpass, @@ -89,7 +89,8 @@ func parseCliOpts() (args argContainer) { // Tri-state true/false/auto flagSet.StringVar(&opensslAuto, "openssl", "auto", "Use OpenSSL instead of built-in Go crypto") flagSet.BoolVar(&args.passwd, "passwd", false, "Change password") - flagSet.BoolVar(&args.foreground, "f", false, "Stay in the foreground") + flagSet.BoolVar(&args.fg, "f", false, "") + flagSet.BoolVar(&args.fg, "fg", false, "Stay in the foreground") flagSet.BoolVar(&args.version, "version", false, "Print version and exit") flagSet.BoolVar(&args.plaintextnames, "plaintextnames", false, "Do not encrypt file names") flagSet.BoolVar(&args.quiet, "q", false, "") diff --git a/daemonize.go b/daemonize.go index 5bfed7d..fa5b6e1 100644 --- a/daemonize.go +++ b/daemonize.go @@ -24,7 +24,7 @@ func exitOnUsr1() { func forkChild() int { go exitOnUsr1() name := os.Args[0] - newArgs := []string{"-f", fmt.Sprintf("-notifypid=%d", os.Getpid())} + newArgs := []string{"-fg", fmt.Sprintf("-notifypid=%d", os.Getpid())} newArgs = append(newArgs, os.Args[1:]...) c := exec.Command(name, newArgs...) c.Stdout = os.Stdout diff --git a/main.go b/main.go index 3dc959f..c5fc3d7 100644 --- a/main.go +++ b/main.go @@ -126,7 +126,7 @@ func main() { args := parseCliOpts() // Fork a child into the background if "-f" is not set AND we are mounting // a filesystem. The child will do all the work. - if !args.foreground && flagSet.NArg() == 2 { + if !args.fg && flagSet.NArg() == 2 { ret := forkChild() os.Exit(ret) }