[haiku-3rdparty-dev] Can Haiku emulate Amiga CLI/GUI startup?

  • From: "Earl Pottinger" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "earl_colby_pottinger@xxxxxxxxx" for DMARC)
  • To: "haiku-3rdparty-dev@xxxxxxxxxxxxx" <haiku-3rdparty-dev@xxxxxxxxxxxxx>
  • Date: Sun, 22 Feb 2015 00:58:03 +0000 (UTC)

I have started rewriting my older software to work with the newer Haiku.  At 
the same time I have been improving the code and it`s speed.
The first package I have rewritten in my FileFilter program.  The new 0.80 
version works fine with Haiku-OS but three years ago I ask if it was possible 
to make a program work like the FORMAT command did on the Amiga.  At the time I 
was told no!  I am hoping that with all the changes to the source code that 
maybe it can be done now.
On the Amiga if you started FORMAT from the CLI you got a CLI program, if 
however you double clicked the icon that pointed to the same code you got a GUI 
version of the program.
This is the behaviour I would like to emulate.
In Haiku-OS I test how many arguments are passed to the program at start-up. 
If the program see more than zero arguments being passed it assumes it is a CLI 
program and only runs in the terminal, if the program see no arguments it is 
assumed that the program was invoked by the GUI and run with a GUI interface.
The problem if I just enter the program name with no arguments in the CLI 
(Terminal) the GUI version is invoked.
Is there any way for a single Haiku-OS program to tell what environment invokes 
the program?

Other related posts: