parent
35930924a7
commit
27f104b3e6
6
app.go
6
app.go
@ -136,6 +136,12 @@ func (app *app) loop() {
|
|||||||
clientChan := app.ui.readExpr()
|
clientChan := app.ui.readExpr()
|
||||||
serverChan := readExpr()
|
serverChan := readExpr()
|
||||||
|
|
||||||
|
if gSelect != "" {
|
||||||
|
go func() {
|
||||||
|
app.ui.exprChan <- &callExpr{"select", []string{gSelect}, 1}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
for _, path := range gConfigPaths {
|
for _, path := range gConfigPaths {
|
||||||
if _, err := os.Stat(path); !os.IsNotExist(err) {
|
if _, err := os.Stat(path); !os.IsNotExist(err) {
|
||||||
app.readFile(path)
|
app.readFile(path)
|
||||||
|
11
main.go
11
main.go
@ -21,11 +21,12 @@ var (
|
|||||||
gHostname string
|
gHostname string
|
||||||
gLastDirPath string
|
gLastDirPath string
|
||||||
gSelectionPath string
|
gSelectionPath string
|
||||||
gCommand string
|
|
||||||
gSocketProt string
|
gSocketProt string
|
||||||
gSocketPath string
|
gSocketPath string
|
||||||
gLogPath string
|
gLogPath string
|
||||||
gServerLogPath string
|
gServerLogPath string
|
||||||
|
gSelect string
|
||||||
|
gCommand string
|
||||||
gVersion string
|
gVersion string
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -155,13 +156,9 @@ func main() {
|
|||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
dir := flag.Arg(0)
|
gSelect = flag.Arg(0)
|
||||||
if err := os.Chdir(dir); err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "%s\n", err)
|
|
||||||
os.Exit(2)
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(os.Stderr, "only single directory is allowed\n")
|
fmt.Fprintf(os.Stderr, "only single file or directory is allowed\n")
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user