main: rename "-f" to "-fg"

"-f" looks too much like "--force". The old variant is still
accepted for compatability.
This commit is contained in:
Jakob Unterwurzacher 2016-11-01 18:59:34 +01:00
parent d6678f73b4
commit b527e205e2
4 changed files with 7 additions and 5 deletions

View File

@ -56,8 +56,9 @@ Options:
stripped by gocryptfs. Using something like "cat /mypassword.txt" allows stripped by gocryptfs. Using something like "cat /mypassword.txt" allows
to mount the gocryptfs filesytem without user interaction. to mount the gocryptfs filesytem without user interaction.
**-f** **-fg, -f**
: Stay in the foreground instead of forking away. Implies "-nosyslog". : Stay in the foreground instead of forking away. Implies "-nosyslog".
For compatability, "-f" is also accepted, but "-fg" is preferred.
**-fusedebug** **-fusedebug**
: Enable fuse library debug output : Enable fuse library debug output

View File

@ -14,7 +14,7 @@ import (
// argContainer stores the parsed CLI options and arguments // argContainer stores the parsed CLI options and arguments
type argContainer struct { type argContainer struct {
debug, init, zerokey, fusedebug, openssl, passwd, foreground, version, debug, init, zerokey, fusedebug, openssl, passwd, fg, version,
plaintextnames, quiet, nosyslog, wpanic, plaintextnames, quiet, nosyslog, wpanic,
longnames, allow_other, ro, reverse, aessiv, nonempty, raw64 bool longnames, allow_other, ro, reverse, aessiv, nonempty, raw64 bool
masterkey, mountpoint, cipherdir, cpuprofile, extpass, masterkey, mountpoint, cipherdir, cpuprofile, extpass,
@ -89,7 +89,8 @@ func parseCliOpts() (args argContainer) {
// Tri-state true/false/auto // Tri-state true/false/auto
flagSet.StringVar(&opensslAuto, "openssl", "auto", "Use OpenSSL instead of built-in Go crypto") flagSet.StringVar(&opensslAuto, "openssl", "auto", "Use OpenSSL instead of built-in Go crypto")
flagSet.BoolVar(&args.passwd, "passwd", false, "Change password") 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.version, "version", false, "Print version and exit")
flagSet.BoolVar(&args.plaintextnames, "plaintextnames", false, "Do not encrypt file names") flagSet.BoolVar(&args.plaintextnames, "plaintextnames", false, "Do not encrypt file names")
flagSet.BoolVar(&args.quiet, "q", false, "") flagSet.BoolVar(&args.quiet, "q", false, "")

View File

@ -24,7 +24,7 @@ func exitOnUsr1() {
func forkChild() int { func forkChild() int {
go exitOnUsr1() go exitOnUsr1()
name := os.Args[0] 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:]...) newArgs = append(newArgs, os.Args[1:]...)
c := exec.Command(name, newArgs...) c := exec.Command(name, newArgs...)
c.Stdout = os.Stdout c.Stdout = os.Stdout

View File

@ -126,7 +126,7 @@ func main() {
args := parseCliOpts() args := parseCliOpts()
// Fork a child into the background if "-f" is not set AND we are mounting // Fork a child into the background if "-f" is not set AND we are mounting
// a filesystem. The child will do all the work. // a filesystem. The child will do all the work.
if !args.foreground && flagSet.NArg() == 2 { if !args.fg && flagSet.NArg() == 2 {
ret := forkChild() ret := forkChild()
os.Exit(ret) os.Exit(ret)
} }