Support for -help, -version, & -console on OS/2

RESOLVED FIXED

Status

()

Toolkit
Startup and Profile System
--
enhancement
RESOLVED FIXED
13 years ago
9 years ago

People

(Reporter: Rich Walsh, Assigned: mkaply)

Tracking

unspecified
x86
OS/2
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 3 obsolete attachments)

(Reporter)

Description

13 years ago
This patch implements an on-demand console window and enables OS/2 users to use
the -help and -version commandline parameters.  It adds a new function,
StartOS2App() which examines the commandline, and if needed, restarts the app in
a VIO session.  The function is intended to be called from xre_main() as early
in the startup processing as possible - in particular, before any other
commandline handling.



The patch also makes minor changes to xre_main and sNativeAppSupportOS2::Start.
It incorporates some of the OS/2 startup code in xre_main as well as a few lines
from Start.  It also modifies Start to remove -console and -dde from the
commandline arguments.  Without this change, a URL immediately following these
args would be ignored.



For lack of a better idea, I've added StartOS2App() to the end of
nsNativeAppSupportOS2 and placed its prototype in xre_main immediately preceding
the call to this function.


FYI... I will submit an xpfe version of this patch in the near future.
(Reporter)

Comment 1

13 years ago
Created attachment 174348 [details] [diff] [review]
patch to implement console window
My c is really rusty but as I read the code I couldn't use both -dde and
-console, is this correct or am I misreading the code?  
Sorry, I read through the code once again and I think I was just misreading it.
(Reporter)

Comment 4

13 years ago
Created attachment 174891 [details] [diff] [review]
updated patch to implement console window

minor update:  adds '-console' to the commandline options displayed by -help
Attachment #174348 - Attachment is obsolete: true
(Assignee)

Comment 5

13 years ago
Comment on attachment 174891 [details] [diff] [review]
updated patch to implement console window

sweet

r=mkaply

although your parenthesis style drives me crazy!
Attachment #174891 - Flags: first-review+
(Reporter)

Comment 6

13 years ago
(In reply to comment #5)
> 
> although your parenthesis style drives me crazy!

Which of the 6 different coding styles in ...AppSupportOS2 is yours?  Are you
the "don't let 'em touch" guy, e.g. if ([space]something[space])?  Please advise
and I will reformat accordingly (n.b. this offer does not extend to putting
braces around single lines - $#@%&!!).
(Assignee)

Comment 7

13 years ago
No big deal. I'm just messing with you. 

I general prefer:

PRBool StartOS2App(int aArgc, char **aArgv);
  if (StartOS2App(gArgc, gArgv))
    return 1;

to

PRBool StartOS2App( int aArgc, char **aArgv);
  if (StartOS2App( gArgc, gArgv))
    return 1;

And yes, I know the argument about easily skipping around in an editor. The
truth be known, I don't even know what the keystroke in EPM is to go word by
word - I just go a character at a time :)

(Assignee)

Comment 8

13 years ago
One more question on this.

I'm not sure on the naming. StartOS2App returns true if we are not going to
start the app, but restart.

Should be maybe call it something different?
(Reporter)

Comment 9

13 years ago
Created attachment 175521 [details] [diff] [review]
updated patch per Comment #8

Per Comment #8 - I've left the name as-is but reversed the sense of the return:
 TRUE if the app should start, FALSE if it should terminate.

Also, per earlier comments, I've reformatted parenthesized expressions so as to
render Ctrl-Right substantially useless...
(Reporter)

Updated

13 years ago
Attachment #174891 - Attachment is obsolete: true
(Reporter)

Comment 10

13 years ago
Created attachment 175794 [details] [diff] [review]
fixes bug in HandleCommandLine()

New code removes "-console" & "-dde" from commandline passed to a running
instance.  Without this, any URL following these args would be ignored.
(Reporter)

Updated

13 years ago
Attachment #175521 - Attachment is obsolete: true
03-04-2005  09:04:07  SYS3183  PID 0069  TID 0001  Slot 00dc
E:\BROWSERS\FIREFOX\FIREFOX.EXE
c000009a
12055653
EAX=00400000  EBX=00d4d6a0  ECX=009cf1a0  EDX=3ff02750
ESI=00000000  EDI=0000041e  
DS=0053  DSACC=f0f3  DSLIM=ffffffff  
ES=0053  ESACC=f0f3  ESLIM=ffffffff  
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:12055653  CSACC=f0df  CSLIM=ffffffff
SS:ESP=0053:009cf120  SSACC=f0f3  SSLIM=ffffffff
EBP=009cf1b8  FLG=00002206

MOZJS.DLL 0001:00015653

when I use firefox!l.exe -help but it still displays the help.
Hadn't built with the xpfe changes yet.  -console and -version work fine, no
popuplog.os2 entries.
Andy
(Assignee)

Comment 12

13 years ago
Fix checked in - r=mkaply, sr=blizzard (platform specific)
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Updated

11 years ago
Flags: in-testsuite-

Updated

9 years ago
Component: XRE Startup → Startup and Profile System
QA Contact: nobody → startup
You need to log in before you can comment on or make changes to this bug.