.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Dominions 3: The Awakening (http://forum.shrapnelgames.com/forumdisplay.php?f=138)
-   -   Command Line Switches - revisited (http://forum.shrapnelgames.com/showthread.php?t=32819)

Psientist January 14th, 2007 02:09 PM

Command Line Switches - revisited
 
It's been posted that to get a list of command line switches, one needs only to run (from the command line):
Quote:

> dom3 -h

However, I'm having trouble generating command line options in the Mac OSX.

To run an application from the command line in OSX (Terminal), one types (for example):
Quote:

> open /Applications/Games/Dominions3/Dominions3.app

However, the following throws an error:
Quote:

> open /Applications/Games/Dominions3/Dominions3.app -h

Any suggestions on how to do this on the Mac? And if it works, how to set it as a permenant command-line setting whenever the game is run?

Olive January 14th, 2007 03:35 PM

Re: Command Line Switches - revisited
 
Doesn't seem to work on windows too. http://forum.shrapnelgames.com/image...s/confused.gif
http://img233.imageshack.us/img233/2661/dom3helpcm3.jpg

Gandalf Parker January 14th, 2007 04:33 PM

Re: Command Line Switches - revisited
 
Short answer: You should find a stdout.txt in your dominions3 directory that has the -h output

Long answer: It does work but windows doesnt handle putting it to the screen the same way Linux does. Or actually I should say that WinNT or WinXP dont (Im guessing thats what you have since nothing showed up). The networking aspect of those two versions of windows, and no dos beneath them, sends the results to stndout.txt and stnderr.txt

Psientist January 14th, 2007 04:54 PM

Re: Command Line Switches - revisited
 
I understand that theory, but it doesn't appear to work. Here is the full contents of the Dominions3 directory, including hidden files:

Quote:


/Applications/Games/Dominions 3$ ls -al
total 24
drwxr-xr-x 7 psientist admin 238 Jan 9 16:37 .
drwxr-xr-x 7 psientist admin 238 Jan 1 19:18 ..
-rw-r--r-- 1 psientist admin 6148 Jan 9 16:37 .DS_Store
drwxr-xr-x 3 psientist admin 102 Aug 29 14:46 Dominions3.app
dr-xr-xr-x 5 psientist admin 170 Aug 29 14:46 doc

The problem is that OSX is also throwing an error; the application never runs the command switch at all:

Quote:


/Applications/Games/Dominions 3$ open Dominions3.app -h
2007-01-14 14:51:33.735 open[4128] No such file: /Applications/Games/Dominions 3/-h


Now, we can try to be more savvy, and open up the OSX Dominion3.app executable (which is actually a directory bundle), and navigate to the application's core MacOS resource:

Quote:

cd Dominions3.app/Contents/MacOS

but the core executable there throws the exact same error:

Quote:

/Applications/Games/Dominions 3/Dominions3.app/Contents/MacOS$ open Dominions3 -h
2007-01-14 14:54:21.612 open[4132] No such file: /Applications/Games/Dominions 3/Dominions3.app/Contents/MacOS/-h


So apparently neither the Windows nor the MacOS command lines are behaving the way you expect. In fact, it *looks* like the Doms3 app is interpreting the "-h" flag as a filename argument, based upon the error response.

Olive January 14th, 2007 06:36 PM

Re: Command Line Switches - revisited
 
@Gandalf Parker : Thanks, it works. http://forum.shrapnelgames.com/images/smilies/happy.gif

alexti January 15th, 2007 12:46 AM

Re: Command Line Switches - revisited
 
I can't say about Mac OSX, but on Windows standard descriptors work the same way as on Linux/UNIX if the application is built as "console" application. If application is built as "Windows" application, standard output isn't going anywhere. The programmer need to reopen descriptors into some file. That's what Dom3 must be doing.

Arralen January 15th, 2007 03:57 AM

Re: Command Line Switches - revisited
 
1 Attachment(s)
Windows
On my W2kSP4 box, running dom3.exe -h at the command prompt does provide me with a stdout.txt containing the info about the command line options ... :

http://www.shrapnelcommunity.com/thr...70-cmdline.png

Ygorl January 15th, 2007 04:34 AM

Re: Command Line Switches - revisited
 
Psientist, you don't want to use the "open" command. Just type /Applications/Games/Dominions 3/Dominions3.app/Contents/MacOS/Dominions3 -h
and you'll get your list.
Note that if you want to run the game this way, say if you like using a nonstandard resolution, you have to run it from a slightly different location (search the forum for other posts by me and others to see how) - but if you just want to run the command-line version (to get help, verify turns, host a turn, etc.) this works fine.
I don't know if open has support for command-line switches to the program you're opening (open is really designed for opening files, not running applications) but even if it doesn you'd probably have to put it in quotes. Anyway, you don't want or need it in this case. Hope this gets you what you need.

Psientist January 15th, 2007 11:49 AM

Re: Command Line Switches - revisited
 
Ygori:

Thanks for the assist. I figured it out, finally. Although I had tried a few times to run the Dominions3 app inside the bundle by *navigating* to that directory (e.g., "cd /Applications/Dominions 3/Dominions3.app/Contents/MacOS/") before running it, it never worked.

But just establishing the current working directory outside of the application bundle, and then running the core app with the entire path specified, did the trick.


So, to repeat for every OSX user's benefit:
1. open terminal.
2. run the following command, adjusting the path to specify the location of your Dominions 3 game folder:
Quote:

/Applications/Games/'Dominions 3'/Dominions3.app/Contents/MacOS/Dominions3 -h

Thanks, Ygori. I'll probably make a script file to execute that without having to go to terminal first, or for setting command-line switches I wish to load every time.

Gandalf Parker January 15th, 2007 04:51 PM

Re: Command Line Switches - revisited
 
I was thinking that from what I read when I tried to google an answer, but I couldnt test it so I kept my mouth shut (for once). The "open" said it opened a gui console. That would seem to be oppossing the result desired for -h and -T. I found examples using open and some that didnt use open but nothing clearly saying why use one and not the other.

Does using the "open" make ALL switches ignored? Do switches such as nofade or nomusic work?


All times are GMT -4. The time now is 12:45 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.