Update fsplc to use new cli features

This commit is contained in:
Sasha Koshka 2024-02-22 20:17:38 -05:00
parent 793314fdd7
commit 367f4c5d34

View File

@ -27,9 +27,6 @@ func main () {
filepath.Join(homeDir, ".local/include/fspl"))
// take in CLI flags
help := cli.NewFlag (
'h', "help",
"Display usage information and exit")
debug := cli.NewFlag (
0, "debug",
"Print extra debug information while compiling")
@ -51,19 +48,15 @@ func main () {
application := cli.New (
"Compile FSPL source files",
help,
cli.NewHelp(),
debug,
quiet,
format,
output,
optimization)
application.Syntax = "[OPTION]... FILE"
application.Syntax = "[OPTION]... ADDRESS"
application.ParseOrExit(os.Args)
if help.Value != "" {
application.Usage()
os.Exit(2)
}
if len(application.Args) != 1 {
comp.Errorln("please specify one unit address")
application.Usage()