When an application program is launched, Nasin should be able to figure out if it is already running, and if so, send messages to it. This mainly applies to applications that satisfy ApplicationURLOpener, but it could also apply to applications that you might have multiple windows of in general (like a calculator). For the second case, we likely will need another API, likely a NewWindow behavior of Application.
To accomplish this, Nasin needs to be able to parse command line args. Since a GUI application doesn't really require a super slick and convenient CLI interface, flag will work just fine here.
The only problem is how to allow A) the application to parse cli args and B) allow nasin to parse cli args, while being able to do B without A, and being able to do B while the configuration for A is not yet defined. We cannot solve this by parsing the arguments twice because the parsing depends on the configuration of A.
When an application program is launched, Nasin should be able to figure out if it is already running, and if so, send messages to it. This mainly applies to applications that satisfy ApplicationURLOpener, but it could also apply to applications that you might have multiple windows of in general (like a calculator). For the second case, we likely will need another API, likely a NewWindow behavior of Application.
To accomplish this, Nasin needs to be able to parse command line args. Since a GUI application doesn't really require a super slick and convenient CLI interface, flag will work just fine here.
The only problem is how to allow A) the application to parse cli args and B) allow nasin to parse cli args, while being able to do B without A, and being able to do B while the configuration for A is not yet defined. We cannot solve this by parsing the arguments twice because the parsing depends on the configuration of A.
AddFlags, if it exists, will be called before Init, and it will add flags to the default flag set that Nasin uses.
The clear solution here is to create another Application interface with an extra AddFlags method that Nasin can check for:
```go
type ApplicationFlagAdder struct {
Application
AddFlags(*flag.FlagSet)
}
```
AddFlags, if it exists, will be called before Init, and it will add flags to the default flag set that Nasin uses.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
When an application program is launched, Nasin should be able to figure out if it is already running, and if so, send messages to it. This mainly applies to applications that satisfy ApplicationURLOpener, but it could also apply to applications that you might have multiple windows of in general (like a calculator). For the second case, we likely will need another API, likely a NewWindow behavior of Application.
To accomplish this, Nasin needs to be able to parse command line args. Since a GUI application doesn't really require a super slick and convenient CLI interface, flag will work just fine here.
The only problem is how to allow A) the application to parse cli args and B) allow nasin to parse cli args, while being able to do B without A, and being able to do B while the configuration for A is not yet defined. We cannot solve this by parsing the arguments twice because the parsing depends on the configuration of A.
This could be done over dbus, however that is not cross platform. Perhaps pid files could be utilized.
The clear solution here is to create another Application interface with an extra AddFlags method that Nasin can check for:
AddFlags, if it exists, will be called before Init, and it will add flags to the default flag set that Nasin uses.