Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ftsize flag wasn't working #144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions 0flags.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package main

import (
"flag"
"runtime"
)

func defaultFaceSize() int {
switch runtime.GOOS {
case "darwin":
return 13
default:
return 11
}
}

var (
utf8 = flag.Bool("u", false, "enable utf8 experiment")
elastic = flag.Bool("elastic", false, "enable elastic tabstops")
oled = flag.Bool("b", false, "OLED display mode (black)")
ftsize = flag.Int("ftsize", defaultFaceSize(), "font size")
srvaddr = flag.String("l", "", "(dangerous) announce and serve file system clients on given endpoint")
clientaddr = flag.String("d", "", "dial to a remote file system on endpoint")
quiet = flag.Bool("q", false, "dont interact with the graphical subsystem (use with -l)")
)

var _ int = parse()

func parse() int {
flag.Parse()
return 0
}
23 changes: 0 additions & 23 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package main // import "github.com/as/a"

import (
"flag"
"fmt"
"image"
"log"
"os"
"runtime"

"github.com/as/shiny/screen"
mus "github.com/as/text/mouse"
Expand All @@ -33,25 +31,6 @@ var (
focused = false
)

func defaultFaceSize() int {
switch runtime.GOOS {
case "darwin":
return 13
default:
return 11
}
}

var (
utf8 = flag.Bool("u", false, "enable utf8 experiment")
elastic = flag.Bool("elastic", false, "enable elastic tabstops")
oled = flag.Bool("b", false, "OLED display mode (black)")
ftsize = flag.Int("ftsize", defaultFaceSize(), "font size")
srvaddr = flag.String("l", "", "(dangerous) announce and serve file system clients on given endpoint")
clientaddr = flag.String("d", "", "dial to a remote file system on endpoint")
quiet = flag.Bool("q", false, "dont interact with the graphical subsystem (use with -l)")
)

func init() {
// this grants the capability to shut down the program
// it happens exactly once
Expand All @@ -60,8 +39,6 @@ func init() {
// error.go:/logFunc/
log.SetFlags(log.Llongfile)
log.SetPrefix("a: ")

flag.Parse()
}

func banner() {
Expand Down