[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Select a startup class from the command line
[Thread Prev] | [Thread Next]
- Subject: Select a startup class from the command line
- From: BB <adamnt42@xxxxxxxxx>
- Date: Tue, 22 Apr 2025 14:34:09 +0930
- To: Gambas Mailing List <user@xxxxxxxxxxxxxxxxxxxxxx>
Is this possible?Some programs run different interfaces depending on the "command" specified on the command line, notably (or perhaps notoriously) "apt". Such as:
apt get <params> apt install <params> apt this-that-and-the-other <params>In my case, I'm trying to develop a library to interface to the OpenWeatherMap feed. It will have 3 modes of operation (so far):
* as a library called from a client application, via an exposed interface class "Weather" * as a normal executable to allow the user to setup some configuration data, such as language, API key, etc * as a normal executable that just shows the weather for a location through a small UIFor the latter two then I want to specify which interface to use is a similar way to the "apt" command:
* weather configure * weather [show] <location params> /[show] is optional, if included, the data is just printed on stdout/Note, this is different from the normal usage of the gb.args component where the "options" must come before the "arguments". Here I have a syntax of
weather <command> <args> <options> So for example, weather show -67.42137331544458, 164.77271477068862 -l zuwould print the current weather conditions on Sturge Island to stdout in the zulu language (should I ever require it 😕).
tia bruce
Re: Select a startup class from the command line | Bruce Steers <bsteers4@xxxxxxxxx> |