aboutsummaryrefslogtreecommitdiffhomepage
path: root/options/parse_commandline.c
Commit message (Collapse)AuthorAge
* m_option: remove redundant indirectionsGravatar wm42017-07-02
| | | | | | Remove the various redundant m_config_set_option* calls, rename the remaining one to m_config_set_option_cli(), and merge the m_config_parse_option() function.
* build: replace glob() check and assume it's always in POSIXGravatar wm42017-06-29
| | | | | POSIX requires glob(), so no need to check for it. Together with the fact that we can emulate glob() on Windows, glob() is always available.
* Revert "parse_commandline: fail gracefully on bad args"Gravatar wm42017-06-24
| | | | | | This reverts commit 38b05daf7d16898f4a63e4ccf48479d8964e6e19. There was actually no LGPL relicensing agreement with wd0.
* options: change license of most files to LGPL (except options.c/.h)Gravatar wm42017-06-12
| | | | | | | | | | | | | | | | | | | | | | | All authors of the current code have agreed (as far as this commit requires). options.c/options.h will take more effort, because it contains all the option declarations, and thus is touched extremely often. m_option.c is technically still GPL, because of commit 2c82d5a1d85378dd0 (michael has agreed to LGPL, but only once the core of mpv is LGPL). The geometry parsing code in m_option.c was originally by someone who could not be reached. However, it was heavily rewritten anyway, and only the syntax remains (i.e. not copyright-relevant). parse_commandline.c contains a change by "adland" (commit 1d0ac71ae8ba), who could not be reached - this this specific part is GPL only. Fortunately, it matters only for DVD (and even then is more like a hack, but whatever). There are some other relevant changes, but they have all been reverted, moved somewhere else, deleted, or replaced.
* parse_commandline: guard glob() useGravatar wm42017-04-04
| | | | Might make porting to batshit environments simpler.
* options: simplify M_OPT_EXITGravatar wm42016-09-17
| | | | | | | | | | | | | There were multiple values under M_OPT_EXIT (M_OPT_EXIT-n for n>=0). Somehow M_OPT_EXIT-n either meant error code n (with n==0 no error?), or the number of option valus consumed (0 or 1). The latter is MPlayer legacy, which left it to the option type parsers to determine whether an option took a value or not. All of this was changed in mpv, by requiring the user to use explicit syntax ("--opt=val" instead of "-opt val"). In any case, the n value wasn't even used (anymore), so rip this all out. Now M_OPT_EXIT-1 doesn't mean anything, and could be used by a new error code.
* options: remove unneeded hack from command line parserGravatar wm42015-04-23
| | | | | | | | | | | | | | | This was traditionally needed to silence terminal output from errors during command line parsing preparsing. Preparsing is done so that options controlling the terminal and config files are parsed and applied first, with a second command line parsing pass applying all other options, _and_ printing error messages for the preparsed ones. But the hack silencing log output during the preparse pass is actually not needed anymore, since the terminal is enabled only after preparsing is finished. update_logging() in main.c does this. So as long as update_logging() is called before m_config_preparse_command_line(), this will work.
* Update license headersGravatar Marcin Kurczewski2015-04-13
| | | | Signed-off-by: wm4 <wm4@nowhere>
* parse_commandline: fail gracefully on bad argsGravatar wd02015-03-29
| | | | | | Args of zero length (i.e. --=) now display a proper error message. Signed-off-by: wm4 <wm4@nowhere>
* player: fix operation if command line is emptyGravatar wm42015-03-06
| | | | | | | main() being called with argc==0 is probably possible. Fix by skipping the program name early. (I already changed and reverted this once, but this time we make sure that it's less likely to confuse the skipped argv with main()'s argv by naming it "options".)
* player: minor simplificationGravatar wm42015-03-05
| | | | | argv is always terminated with a NULL, so we don't need to drag argc along. Simplifies the following commit a little bit.
* demux: add a demux_open_url() functionGravatar wm42015-02-20
| | | | | Often stream and a demuxer are opened at the same time. Provide a function for this and replace most of its uses.
* options: add slightly more sophistcated mechanism for option deprecationGravatar wm42014-12-11
|
* terminal: strictly don't read terminal input if stdout is not a terminalGravatar wm42014-10-23
| | | | | | | | | | | | | Doing that doesn't make sense anyway: it's meant for interactive input, and if the output of the player is not on the terminal, how will you interact with it? It was also quite in the way when trying to read verbose output with e.g. less while the player was running, because the player would grab half of all input meant for less (simply because stdin is still connected to the terminal). Remove the now redundant special-casing of pipe input.
* options: fix "-" (stdin) inputGravatar wm42014-05-06
| | | | | Input through stdin requires disabling the terminal layer, and commit 32c63f forgot to rename the option correctly.
* options: let unknown option case be handled by final option parserGravatar wm42014-05-05
| | | | | | | If an option is completely missing, let m_config_parse_option() handle this case, instead of erroring out early. Needed for the following commit.
* options: rename input-related optionsGravatar Martin Herkt2014-05-04
| | | | | | | | | | | --ar → --input-appleremote --consolecontrols → --input-terminal --media-keys → --input-media-keys --joystick → --input-joystick --lirc → --input-lirc --lircconf → --input-lirc-conf --mouse-movements → --input-cursor --right-alt-gr → --input-right-alt-gr
* build: glob() is always availableGravatar wm42014-04-22
| | | | | | | | | glob() is mandated by POSIX. For the only non-POSIX platform we support, Windows, we have our own replacement. So the ifdeffery is not needed. Still leave the checks in the configure scripts, because they have to decide whether to compile the replacement or not. (Although this could be special cased to mingw-only, the wscript seems to make this hard.)
* parse_commandline: glob filenames on WindowsGravatar James Ross-Gowan2014-04-21
| | | | | | The Windows port uses CommandLineToArgvW, which doesn't expand wildcards in command line arguments. Use glob to expand them instead, but only for non-option arguments.
* player: remove ASX, SMIL and NSC playlist parsersGravatar wm42014-04-13
| | | | | | | | | | | | | | | | | | | These playlist parsers are all what's left from the old mplayer playlist parsing code. All of it is old code that does little error checking; the type of C string parsing code that gives you nightmare. Some playlist parsers have been rewritten and are located in demux_playlist.c. The removed formats were not reimplemented. ASX and SMIL use XML, and since we don't want to depend on a full blown XML parser, this is not so easy. Possibly these formats could be supported by writing a very primitive XML-like lexer, which would lead to success with most real world files, but I haven't attempted that. As for NSC, I couldn't find any URL that worked with MPlayer, and in general this formats seems to be more than dead. Move playlist_parse_file() to playlist.c. It's pretty small now, and basically just opens a stream and a demuxer. No use keeping playlist_parser.c just for this.
* player: remove confusing argc/argv adjustmentGravatar wm42014-03-23
| | | | It's better if argc/argv always mean the same thing.
* options: fix allowed DVD start titleGravatar wm42014-03-17
|
* msg: move special declarations to msg_control.hGravatar wm42014-01-16
| | | | | While almost everything uses msg.h, the moved definitions are rarely needed by anything.
* msg: remove global stateGravatar wm42013-12-21
|
* playlist_parser: mp_msg conversionGravatar wm42013-12-21
|
* options: some more mp_msg conversionsGravatar wm42013-12-21
|
* msg: change hack to silence command line pre-parse error messagesGravatar wm42013-12-20
| | | | mp_msg_levels[] will go away.
* Split mpvcore/ into common/, misc/, bstr/Gravatar wm42013-12-17
|
* Move options/config related files from mpvcore/ to options/Gravatar wm42013-12-17
Since m_option.h and options.h are extremely often included, a lot of files have to be changed. Moving path.c/h to options/ is a bit questionable, but since this is mainly about access to config files (which are also handled in options/), it's probably ok.