Celestia 1.4 FT1.1ish OS X Build 10-13-2005 !!!!!

General discussion about Celestia that doesn't fit into other forums.
hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #21by hank » 02.11.2005, 16:12

BlindedByTheLight wrote:
hank wrote:As far as I can tell, the Mac OS X version of Celestia ignores any command line arguments.

- Hank

Hank, since you're the resident Mac OS X guru... could you give me a little background on this?

As far as my knowledge goes, aliases/short-cuts from the Apple GUI have no "command line" or any tweaking at all you can do with them through the GUI.

The only command line I am aware of is the Unix command line, available solely through the Mac OS X app called "Terminal".

Are you guys say that there is ANOTHER way to create aliases/short-cuts in Mac OS X from THIS command line that will, in theory, behave as you are saying?

Thanks


What I'm saying is that the code ignores whatever command line arguments (if any) are specified. So even if you could run the program from the command line and specify command line arguments, they would have no effect. Presumably code could be added to process command line arguments, but it's not there now. At least, I didn't see it.

The other issue is how to specify command line arguments when you launch the program. I don't think the Mac OS X launch services support that directly, so some kind of workaround would be needed.

But I guess I'm not sure this is really the way to go for Mac OS X.

- Hank

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #22by BlindedByTheLight » 02.11.2005, 18:53

hank wrote:What I'm saying is that the code ignores whatever command line arguments (if any) are specified.


Thanks... but I actually needed (and still need) a crucial bit of info to process any of that stuff - i.e. what the heck is a command line? :)
Steven Binder, Mac OS X 10.4.10

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #23by hank » 02.11.2005, 19:02

BlindedByTheLight wrote:
hank wrote:What I'm saying is that the code ignores whatever command line arguments (if any) are specified.

Thanks... but I actually needed (and still need) a crucial bit of info to process any of that stuff - i.e. what the heck is a command line? :)

For what purpose do you need this info? I'm not sure I understand what you're asking.

- Hank

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #24by selden » 02.11.2005, 19:29

In order to provide a command-line qualifier to Celestia, of course!

A "command line" is a line of text typed to a serial terminal or to a serial terminal emulator which is interpreted by the operating system as a command to do something. (In this case, we want the operating systme to load the program Celestia into memory and to transfer some parameters to Celestia when it starts.)

For many years, serial terminals were the only method available to interact with computers.

Some of the early ones were ASR-33 Teletypes, for example, which typed at the incredibly high speed of 10 characters per second. They were replaced by CRT terminals, which worked at speeds of 240, 480 and eventually 960 characters per second.

Most modern operating systems include both serial and graphical user interfaces. The graphical interfaces usually provide an on-screen terminal emulator to which you can type a command line.

When a program is started by a desktop icon used by Windows, it sees a command line which is defined in the icon's "Target" property field. I don't know if MacOS and Linux do something similar.

Does this help?
Selden

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #25by hank » 02.11.2005, 19:56

selden wrote:In order to provide a command-line qualifier to Celestia, of course!

But presumably, if one wanted to provide a command-line qualifier to Celestia, one would know what a command line is. That's why I was puzzled by the question.

The answer that a command line is "a line of text typed to a serial terminal or to a serial terminal emulator" might be correct as far as it goes, but I suspect it doesn't address the issue here. As you indicated, in Windows, a "command line" is also (evidently) a line of text defined in a desktop icon's "Target" property field, which a program sees when it is started by a desktop icon. But that definition would not apply to Mac OS X.

- Hank

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #26by BlindedByTheLight » 02.11.2005, 20:11

hank wrote:For what purpose do you need this info? I'm not sure I understand what you're asking.

selden wrote:In order to provide a command-line qualifier to Celestia, of course!

hank wrote:But presumably, if one wanted to provide a command-line qualifier to Celestia, one would know what a command line is. That's why I was puzzled by the question.


Well, first off - thank you very much Selden - for clearing things up and for the history lesson. It was much appreciated.

As for Hank, yes, Selden was correct when he answered your first question by stating "in order to provide a command-line qualifier to Celestia". Of course, you are also right in saying "if one wanted to provide a command-line qualifier to Celestia, one would [probably] know what a command line is".

However, another way of stating your comment is that "if one wanted to provide the FUNCTIONALITY that a command-line qualifier provides to Celestia, one would know what a command-line is". That, of course, is not necessarily a true statement.

In other words, I understood the functionality of what fsregs was asking for... a way to open Celestia and force it to use a different cfg file. I also understood that the way that is done in Windows is via some "command line" statements entered via a short-cut - which then instructed Celestia to behave as desired.

What I didn't know was what a command line was. I was guessing that it had something to do with the Mac OS X Terminal application... but I was thrown off by the fact that, apparently, one can enter command lines into Windows short-cuts where there is no corollary in the OS X world. Often there are corollary's, so I was wondering if I had it all wrong. Hence my question, "what the heck is a command line"?

The question wasn't intended, necessarily, to address the issue or problems with achieving the same functionality in OS X (something I do not REMOTELY have the skills to do). It really was for my own education and to enable me to understand the ins and outs of the desired functionality once it is achieved to properly test it for fsregs. In other words... you all have an incredible fountain of knowledge I am whorishly trying to suck up as much as I can! :)

Another question for ya... is there a standard language that terminal commands always use? Mostly use? And I assume the terminals (emulated or not) are "plugged in" to the hardware at a lower level?

Thanks again all!
Last edited by BlindedByTheLight on 02.11.2005, 20:16, edited 2 times in total.
Steven Binder, Mac OS X 10.4.10

Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 3 months
Location: Brittany, close to the Ocean

Post #27by Boux » 02.11.2005, 20:13

selden wrote:In order to provide a command-line qualifier to Celestia, of course!

A "command line" is a line of text typed to a serial terminal or to a serial terminal emulator which is interpreted by the operating system as a command to do something. (In this case, we want the operating systme to load the program Celestia into memory and to transfer some parameters to Celestia when it starts.)

For many years, serial terminals were the only method available to interact with computers.

Some of the early ones were ASR-33 Teletypes, for example, which typed at the incredibly high speed of 10 characters per second. They were replaced by CRT terminals, which worked at speeds of 240, 480 and eventually 960 characters per second.

Most modern operating systems include both serial and graphical user interfaces. The graphical interfaces usually provide an on-screen terminal emulator to which you can type a command line.

When a program is started by a desktop icon used by Windows, it sees a command line which is defined in the icon's "Target" property field. I don't know if MacOS and Linux do something similar.

Does this help?


Yep, Selden, I can confirm that under Linux you can pass any kind of parameters to an executable through a link to the executable (shortcut or aliases in other operating systems). It is very similar to the Windows way actually.

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #28by selden » 02.11.2005, 20:41

BlindedByTheLight wrote:Another question for ya... is there a standard language that terminal commands always use? Mostly use?

The command-line interpreter used most frequently these days seems to be the one named "bash" (Bourne-Again Shell -- a pun. Bourne is the name of one of the people who wrote the original Unix command language, sh, also known as Bourne Shell)

bash is available under Windows if you install Cygwin (a free unix environment).
It's one of several command languages available on all Linux and MacOS X systems

And I assume the terminals (emulated or not) are "plugged in" to the hardware at a lower level?


Yes. Well. Sort of. It's complicated :)
Plugged into the operating system at a lower level, certainly.

Serial console ports can be used on most computers, including PCs, instead of graphical interfaces. Many of the Unix servers at the lab where I work have no graphics hardware at all.
Selden

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #29by hank » 02.11.2005, 22:39

BlindedByTheLight wrote:As for Hank, yes, Selden was correct when he answered your first question by stating "in order to provide a command-line qualifier to Celestia". Of course, you are also right in saying "if one wanted to provide a command-line qualifier to Celestia, one would [probably] know what a command line is".

However, another way of stating your comment is that "if one wanted to provide the FUNCTIONALITY that a command-line qualifier provides to Celestia, one would know what a command-line is". That, of course, is not necessarily a true statement.
Right. That's why I asked what your purpose was, i.e. what functionality you were looking for. Selden's response "in order to provide a command-line qualifier to Celestia" didn't clarify that. So it wasn't a useful response to my question.

BlindedByTheLight wrote:In other words, I understood the functionality of what fsregs was asking for... a way to open Celestia and force it to use a different cfg file. I also understood that the way that is done in Windows is via some "command line" statements entered via a short-cut - which then instructed Celestia to behave as desired.
That's what I was asking you to clarify: the functionality you're looking for is a way to open Celestia using a different cfg file. As previously indicated, I'm not sure that the Windows approach really makes sense for Mac OS X.

BlindedByTheLight wrote:What I didn't know was what a command line was. I was guessing that it had something to do with the Mac OS X Terminal application... but I was thrown off by the fact that, apparently, one can enter command lines into Windows short-cuts where there is no corollary in the OS X world. Often there are corollary's, so I was wondering if I had it all wrong. Hence my question, "what the heck is a command line"?
Your previous reference to the Terminal app indicated to me that you did have a basic idea of what a command line is. So I thought you must be asking something different. I understand now that you were really asking about Windows short-cuts. (You probably already know more about that than I do.)

BlindedByTheLight wrote:The question wasn't intended, necessarily, to address the issue or problems with achieving the same functionality in OS X (something I do not REMOTELY have the skills to do). It really was for my own education and to enable me to understand the ins and outs of the desired functionality once it is achieved to properly test it for fsregs.
If we don't address the issue or problems with achieving the same functionality in OS X, how will it ever be achieved?

BlindedByTheLight wrote:Another question for ya... is there a standard language that terminal commands always use? Mostly use? And I assume the terminals (emulated or not) are "plugged in" to the hardware at a lower level?

There is no standard command language on Unix systems, although there are a few that are widely used. However, they all provide command line arguments to programs in the same way: as an array of strings. While Mac OS X is Unix-based, its application architecture is more complex, and applications do not generally run as Unix commands. There is an "open" command which can be used to launch an application from the command line, but it does not allow command line arguments to be specified.

- Hank

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #30by BlindedByTheLight » 02.11.2005, 23:13

Thanks for the added info. However, lol...

Your previous reference to the Terminal app indicated to me that you did have a basic idea of what a command line is.

...then I have misled you. I know my posts someimtes seem to indicate I know more than I do - which I why I am not just being modest when I constantly write "Keep in mind, I have NO idea what I'm talking about."

So, other than knowing there is an app called Terminal and having heard the words "command line" associated with it, I really didn't know more than that. I didn't really know what a "command line" was (I mean, I could sorta guess that it was place you entered commands, ie. instructions), if a "command line" was exclusive to this mysterious app called Terminal or if other aspects of the OS could access it - or even have their very own special "command line" language. I do, however, have a slightly better understanding of it now. And for that, another thank you.

I understand now that you were really asking about Windows short-cuts. (You probably already know more about that than I do.)

I was actually asking the larger question of just what the heck a "command line" was (whether or not I asked it well is now a moot point) because I've always been curious what people were talking about when I heard that term. I've heard it associated with Terminal... that's about it.

As for Windows short-cuts, I GUARANTEE you know more about them than I. But I wasn't really asking about them. Just curious what fsregs was talking about being able to add some mysterious "command line" to it since I had NO idea what he was talking about vis a vis the term "command line". I was able to follow the FUNCTIONs he was describing about short-cuts just fine... I just didn't know anything about the tools he was using.

hank wrote:
BlindedByTheLight wrote:The question wasn't intended, necessarily, to address the issue or problems with achieving the same functionality in OS X (something I do not REMOTELY have the skills to do). It really was for my own education and to enable me to understand the ins and outs of the desired functionality once it is achieved to properly test it for fsregs.
If we don't address the issue or problems with achieving the same functionality in OS X, how will it ever be achieved?


I think you misunderstood me here. I wasn't suggesting at all the function shouldn't be achieved. Quite the contrary... which is why I posted fsregs PM to me in the first place - to help it GET achieved. I was simply saying that, other than testing, I can contribute nothing to the conversation - being, as I'm sure you now see, a COMPLETE non-pro in coding matters.
Steven Binder, Mac OS X 10.4.10

alphap1us
Posts: 212
Joined: 17.12.2003
With us: 20 years 11 months
Location: Buenos Aires

Post #31by alphap1us » 03.11.2005, 18:52

HI,
So how hard would it be to add proper argv support to the Mac version of Celestia? Presumably this would include an error message when unrecognized flags are passed. This seems rather important, especially since Frank's Educational Activities will soon rely on specifcying alternate config files.

Cheers,
Joe

P.S. argv basically means "command-line options". This is because of the way that options are passed to the function that is being called.

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #32by hank » 03.11.2005, 20:35

alphap1us wrote:HI,
So how hard would it be to add proper argv support to the Mac version of Celestia? Presumably this would include an error message when unrecognized flags are passed. This seems rather important, especially since Frank's Educational Activities will soon rely on specifcying alternate config files.

Cheers,
Joe

P.S. argv basically means "command-line options". This is because of the way that options are passed to the function that is being called.


Joe,

As far as I can tell, Mac apps don't normally support command line options (likely due to the Mac's GUI orientation).

- Hank

alphap1us
Posts: 212
Joined: 17.12.2003
With us: 20 years 11 months
Location: Buenos Aires

Post #33by alphap1us » 03.11.2005, 23:51

Hi Hank,

Oh. I never thought about it that way. What would you suggest as the best way to change the start-up parameters of Celestia - storing the settings in the preferences .plist file?

Cheers,
Joe

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #34by BlindedByTheLight » 04.11.2005, 00:09

Just a thought... most programs can open by double-clicking a document file...

I.E. if you click a microsoft word document... it will open microsoft word AND THEN also open that document.

Is there some way to create a document that will also open celestia... then the document opens INSIDE celestia (something OS X seems to do a-ok already).

Then Celestia can be tweaked to check the first few lines of text in this document - which can then give it the specific info we're trying to give it?
Steven Binder, Mac OS X 10.4.10

hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #35by hank » 04.11.2005, 02:57

alphap1us wrote:Hi Hank,

Oh. I never thought about it that way. What would you suggest as the best way to change the start-up parameters of Celestia - storing the settings in the preferences .plist file?

Cheers,
Joe

At this point I'm not really sure what the best approach would be, partly because I don't think I fully understand the requirements. It would be helpful to have more specifics. Using the Mac OS X user defaults (preferences) system is one possibility, but would involve devising some way to set the proper defaults before launching Celestia. Using an args file or the config file itself as a startup document for Celestia is another possibility. There may be others.

- Hank

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #36by dirkpitt » 21.11.2005, 01:24

hank wrote:
alphap1us wrote:Hi Hank,

Oh. I never thought about it that way. What would you suggest as the best way to change the start-up parameters of Celestia - storing the settings in the preferences .plist file?

Cheers,
Joe
At this point I'm not really sure what the best approach would be, partly because I don't think I fully understand the requirements. It would be helpful to have more specifics. Using the Mac OS X user defaults (preferences) system is one possibility, but would involve devising some way to set the proper defaults before launching Celestia. Using an args file or the config file itself as a startup document for Celestia is another possibility. There may be others.

- Hank


Sorry for the long absence. There's no code to handle -conf, but I added code to handle -extrasDirs a while back:

CelestiaAppCore.mm

You'd have to launch Celestia from Terminal like:

Code: Select all

Celestia.app/Contents/MacOS/Celestia -extrasDirs "(/Users/dirkpitt/Desktop/M4, /Users/dirkpitt/Desktop/BigHubbleCMOD)"


although an "extrasDirs" key could be added to the net.shatters.Celestia.plist preferences file instead. This isn't very Mac-like however, and perhaps some sort of window should be popped up on start up that would allow users to change these settings interactively. The window would only popup if you pressed a hotkey combination (some Aspyr games do this for example). Does this sound like a good idea?

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #37by BlindedByTheLight » 21.11.2005, 02:52

Welcome back Dirkpitt!

I guess fsregs will weight in if your idea works... but got a question...

Rather than do all that coding with a pop-up window (which IS a great idea in and of itself but seems like it would take a lot of work) isn't it a relatively straightforward procedure to write an Applescript that will automatically send a terminal command?
Steven Binder, Mac OS X 10.4.10

alphap1us
Posts: 212
Joined: 17.12.2003
With us: 20 years 11 months
Location: Buenos Aires

Post #38by alphap1us » 21.11.2005, 03:19

Hi,
I'm also glad you're back dirkpitt. Could you specify more about the extrasDirs switch? Can you simply specify an entire directoy that contains add-on folders, or do you have to specify each add-on individually, as you did in the example? And do you have to specify absolute paths, or which directory is taken as the "base" dir?

@Steven: I am not sure why Applescript is under discussion. It's very simple to create double-clickable shell script that is will execute any series of commands in the terminal.

Cheers,
Joe

Topic author
BlindedByTheLight
Posts: 485
Joined: 19.03.2005
With us: 19 years 8 months
Location: Los Angeles, CA

Post #39by BlindedByTheLight » 21.11.2005, 03:31

alphap1us wrote:@Steven: I am not sure why Applescript is under discussion. It's very simple to create double-clickable shell script that is will execute any series of commands in the terminal.

Cheers,
Joe


Oh... well, that's fine, too. I didn't mention shell scripts because I have NO idea what they are or how to make them. :)

But, functionally, if they do not require any non-standard software, sounds good to me. At the end of the day, what fsregs is really trying to do is:

A) Get Celestia to open using a different celestia.cfg file

and the reason he is doing that is, because I believe he is trying to get celestia to:

B) load specific sets of add-ons for his Educational Activities (and maybe other things he might have tweaked in the .cfg file?)

Thanks
Steven Binder, Mac OS X 10.4.10

alphap1us
Posts: 212
Joined: 17.12.2003
With us: 20 years 11 months
Location: Buenos Aires

Post #40by alphap1us » 21.11.2005, 05:10

OK, then I think I can solve Frank's problem as soon as I hear from dirkpitt about the syntax and limitations of the extras dir command syntax.

Cheers,
Joe


Return to “Celestia Users”