@@ -145,26 +145,16 @@ static int php_optind = 1;
145
145
static zend_module_entry cgi_module_entry ;
146
146
147
147
static const opt_struct OPTIONS [] = {
148
- {'a' , 0 , "interactive" },
149
- {'C' , 0 , "no-chdir" },
150
148
{'c' , 1 , "php-ini" },
151
149
{'d' , 1 , "define" },
152
150
{'e' , 0 , "profile-info" },
153
- {'f' , 1 , "file" },
154
151
{'h' , 0 , "help" },
155
152
{'i' , 0 , "info" },
156
- {'l' , 0 , "syntax-check" },
157
153
{'m' , 0 , "modules" },
158
154
{'n' , 0 , "no-php-ini" },
159
- {'q' , 0 , "no-header" },
160
- {'s' , 0 , "syntax-highlight" },
161
- {'s' , 0 , "syntax-highlighting" },
162
- {'w' , 0 , "strip" },
163
155
{'?' , 0 , "usage" },/* help alias (both '?' and 'usage') */
164
156
{'v' , 0 , "version" },
165
157
{'y' , 1 , "fpm-config" },
166
- {'z' , 1 , "zend-extension" },
167
- {'T' , 1 , "timing" },
168
158
{'-' , 0 , NULL } /* end of args */
169
159
};
170
160
@@ -971,29 +961,18 @@ static void php_cgi_usage(char *argv0)
971
961
prog = "php" ;
972
962
}
973
963
974
- php_printf ( "Usage: %s [-q] [-h] [-s] [-v] [-i] [-f <file>]\n"
975
- " %s <file> [args...]\n"
976
- " -a Run interactively\n"
977
- " -b <address:port>|<port> Bind Path for external FASTCGI Server mode\n"
978
- " -C Do not chdir to the script's directory\n"
964
+ php_printf ( "Usage: %s [-n] [-e] [-h] [-i] [-m] [-v] [-c <file>] [-d foo[=bar]] [-y <file>]\n"
979
965
" -c <path>|<file> Look for php.ini file in this directory\n"
980
966
" -n No php.ini file will be used\n"
981
967
" -d foo[=bar] Define INI entry foo with value 'bar'\n"
982
968
" -e Generate extended information for debugger/profiler\n"
983
- " -f <file> Parse <file>. Implies `-q'\n"
984
969
" -h This help\n"
985
970
" -i PHP information\n"
986
- " -l Syntax check only (lint)\n"
987
971
" -m Show compiled in modules\n"
988
- " -q Quiet-mode. Suppress HTTP Header output.\n"
989
- " -s Display colour syntax highlighted source.\n"
990
972
" -v Version number\n"
991
- " -w Display source with stripped comments and whitespace.\n"
992
973
" -y, --fpm-config <file>\n"
993
- " Specify alternative path to FastCGI process manager config file.\n"
994
- " -z <file> Load Zend extension <file>.\n"
995
- " -T <count> Measure execution time of script repeated <count> times.\n" ,
996
- prog , prog );
974
+ " Specify alternative path to FastCGI process manager config file.\n" ,
975
+ prog );
997
976
}
998
977
/* }}} */
999
978
@@ -1662,6 +1641,7 @@ int main(int argc, char *argv[])
1662
1641
exit_status = 0 ;
1663
1642
goto out ;
1664
1643
1644
+ default :
1665
1645
case 'h' :
1666
1646
case '?' :
1667
1647
cgi_sapi_module .startup (& cgi_sapi_module );
@@ -1693,6 +1673,19 @@ int main(int argc, char *argv[])
1693
1673
goto out ;
1694
1674
}
1695
1675
}
1676
+
1677
+ /* No other args are permitted here as there is not interactive mode */
1678
+ if (argc != php_optind ) {
1679
+ cgi_sapi_module .startup (& cgi_sapi_module );
1680
+ php_output_startup ();
1681
+ php_output_activate (TSRMLS_C );
1682
+ SG (headers_sent ) = 1 ;
1683
+ php_cgi_usage (argv [0 ]);
1684
+ php_end_ob_buffers (1 TSRMLS_CC );
1685
+ exit_status = 0 ;
1686
+ goto out ;
1687
+ }
1688
+
1696
1689
php_optind = orig_optind ;
1697
1690
php_optarg = orig_optarg ;
1698
1691
0 commit comments