This repository has been archived on 2026-05-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
spliti/main.go
2026-01-21 03:36:13 +09:00

53 lines
1.2 KiB
Go
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package main
import (
"fmt"
"os"
"strconv"
)
var sofname = "spliti"
var version = "2.3.0"
func help() {
fmt.Println(" " + sofname + "-" + version + " - mixi向けプライバシーUI")
fmt.Println("https://mixi.076.moe/ | https://gitler.moe/suwako/spliti")
fmt.Println("")
fmt.Println("使い方:")
fmt.Println(sofname + " -v :バージョンを表示")
fmt.Println(sofname + " -s [ポート番号] ポート番号でウエブサーバーを実行デフォルト9930")
fmt.Println(sofname + " -h :ヘルプを表示")
}
func main() {
cnf, err := getconf()
if err != nil {
fmt.Println(err)
return
}
args := os.Args
if len(args) == 3 && args[1] == "-s" {
if port, err := strconv.Atoi(args[2]); err != nil {
fmt.Printf("%qは数字ではありません。\n", args[2])
return
} else {
serv(cnf, port)
return
}
} else if len(args) == 2 {
if args[1] == "-v" {
fmt.Println(sofname + "-" + version)
} else if args[1] == "-s" {
serv(cnf, 9930)
} else {
help()
return
}
} else {
help()
return
}
}