]> Cypherpunks.ru repositories - goredo.git/blobdiff - main.go
Fix workability under GNU/Linux and other systems because of different syscall
[goredo.git] / main.go
diff --git a/main.go b/main.go
index 9df1bc2bfb10f2807aa5c1fe9855a7430d440aa5..1262c57f53c2451a7459384d1f001b0528503ca1 100644 (file)
--- a/main.go
+++ b/main.go
@@ -1,6 +1,6 @@
 /*
 goredo -- redo implementation on pure Go
-Copyright (C) 2020 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2020-2021 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -31,7 +31,6 @@ import (
        "strings"
 
        "go.cypherpunks.ru/recfile"
-       "golang.org/x/sys/unix"
 )
 
 var (
@@ -60,7 +59,7 @@ func mustParseFd(v, name string) *os.File {
 func main() {
        version := flag.Bool("version", false, "print version")
        warranty := flag.Bool("warranty", false, "print warranty information")
-       symlinks := flag.Bool("symlinks", false, "create necessary symlinks in current direcotyr")
+       symlinks := flag.Bool("symlinks", false, "create necessary symlinks in current directory")
 
        flag.Usage = usage
        flag.Parse()
@@ -96,7 +95,7 @@ func main() {
        log.SetFlags(0)
 
        var err error
-       Cwd, err = unix.Getwd()
+       Cwd, err = os.Getwd()
        if err != nil {
                panic(err)
        }
@@ -120,6 +119,9 @@ func main() {
        if *flagStderrSilent {
                mustSetenv(EnvStderrSilent, "1")
        }
+       if *flagNoProgress {
+               mustSetenv(EnvNoProgress, "1")
+       }
        if *flagDebug {
                mustSetenv(EnvDebug, "1")
        }
@@ -137,6 +139,7 @@ func main() {
        }
        StderrKeep = os.Getenv(EnvStderrKeep) == "1"
        StderrSilent = os.Getenv(EnvStderrSilent) == "1"
+       NoProgress = os.Getenv(EnvNoProgress) == "1"
        Debug = os.Getenv(EnvDebug) == "1"
        LogWait = os.Getenv(EnvLogWait) == "1"
        LogLock = os.Getenv(EnvLogLock) == "1"