mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-08 07:53:54 +00:00
add beginnings of support for -h, -help, --help, -v, -version, --version. note how the code for this happens way early in main(), before any COM or profile stuff. when running with -v and -h it should be quick.
This commit is contained in:
parent
c5e68fac46
commit
0804b138df
@ -52,7 +52,7 @@ debugging=0
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case $1 in
|
||||
-h | --help)
|
||||
-h | --help )
|
||||
script_args="$script_args -h"
|
||||
shift
|
||||
;;
|
||||
@ -70,7 +70,7 @@ do
|
||||
# keep this in synch with
|
||||
# mozilla/xpfe/bootstrap/nsAppRunner.cpp
|
||||
# and mozilla/profile/src/nsProfile.cpp
|
||||
-P | -CreateProfile | -ProfileManager | -ProfileWizard | -installer | -edit | -mail | -news | -pref | -compose | -editor | -addressbook | -chrome )
|
||||
-v | --version | -h | --help | -P | -CreateProfile | -ProfileManager | -ProfileWizard | -installer | -edit | -mail | -news | -pref | -compose | -editor | -addressbook | -chrome )
|
||||
if [ "x$moreargs" != "x" ]
|
||||
then
|
||||
echo "You can't have $1 and $moreargs"
|
||||
|
@ -593,10 +593,33 @@ static nsresult main1(int argc, char* argv[])
|
||||
return rv ;
|
||||
}
|
||||
|
||||
static
|
||||
void DumpHelp(char *appname)
|
||||
{
|
||||
printf("%s: help info here\n", appname);
|
||||
}
|
||||
|
||||
static
|
||||
void DumpVersion(char *appname)
|
||||
{
|
||||
printf("%s: version info\n", appname);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
/* -help and -version should return quick */
|
||||
if (argc == 2) {
|
||||
if ((PL_strcmp(argv[1], "-h") == 0) || (PL_strcmp(argv[1], "-help") == 0) || (PL_strcmp(argv[1], "--help") == 0)) {
|
||||
DumpHelp(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
else if ((PL_strcmp(argv[1], "-v") == 0) || (PL_strcmp(argv[1], "-version") == 0) || (PL_strcmp(argv[1], "--version") == 0)) {
|
||||
DumpVersion(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if( !NS_CanRun() )
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user