summaryrefslogtreecommitdiffstats
path: root/parser-mpcmd.c
Commit message (Collapse)AuthorAgeFilesLines
* options: commandline: support "--no-opt" for flag optionsUoti Urpala2011-09-011-6/+39
| | | | | | | | | | | | | | | When parsing the command line, map "--no-foo" to "--foo=no" if an option named "foo" exists and is a flag option. Non-empty parameters are not allowed with this syntax ("--no-foo=no" is invalid). This implementation is different from the existing "--nofoo" variants for most flag options. Those are implemented as completely separate options; there's an option named "fs" and a separate option named "nofs" (thus "--no-nofs" actually works after this change...). The reason for adding the new syntax is to support the much more standard "--no-" prefix and to allow eventually cleaning up the option handling (though the "nofoo" variants of existing options can't be removed soon due to backwards compatibility).
* options: commandline: don't set bogus playtree option paramsUoti Urpala2011-07-311-0/+2
| | | | | | | | | | | | | | The command line parsing code recorded the next commandline argument, if any, as the parameter of any option recorded to playtree. Thus a command line like "mplayer file -fs -aid 1" would record option "-fs" with a bogus argument "-aid". Historically this triggered no visible problems because such bogus arguments were silently ignored when interpreting the options later. However after recent commit 507fa7e2c2 ("options: indicate ambiguous option parameters explicitly") parameters to flag options are no longer ignored, and the bogus values now triggered parsing errors. Add a check to stop recording parameters for old-style single-dash options if m_config_check_option() says the option did not consume any arguments.
* options: commandline: print error type for parse failuresUoti Urpala2011-07-291-2/+9
| | | | | | | | | | | | If parsing an option fails, print a string corresponding to the parse function return value (M_OPT_MISSING_PARAM etc). The primary motivation is that the parsing code already outputs messages explaining most problems, but does not itself print anything in the missing parameter case. Before double-dash --options such errors were rare (or rather they resulted in the next commandline argument being silently misinterpreted as an argument to the previous option instead); but now an argument like "--ss" should give a better indication about the problem than just "Error parsing option".
* options: commandline: accept --foo=xyz style optionsUoti Urpala2011-07-291-113/+101
| | | | | | | | | | | | Allow writing commandline options with two leading dashes. In this mode a parameter for the option, if any, follows after a '='; following separate commandline arguments are never consumed as a parameter to a previous double-dash option. Flag options may omit parameter and behave like old single-dash syntax. "--fs=yes", "--fs=no" and "--fs" are all valid; the first two behave like configuration file "fs=yes" and "fs=no", and last is the same as old "-fs" (same effect as "--fs=yes").
* options: commandline: allow "--" without filenames after itUoti Urpala2011-07-291-8/+2
| | | | | | | | | A "--" argument on the command line is used to indicate that all following arguments should be interpreted as filenames, not options. Specifying it as the last argument was considered an error. I see no particular reason to forbid the following filename list to be empty, nor do other programs with similar functionalitly I know about treat it that way. So just ignore a "--" with no more arguments.
* options: change option parsing to use bstrUoti Urpala2011-07-291-8/+8
| | | | | | Using bstr allows simpler parsing code, especially because it avoids the need to modify or copy strings just to terminate extracted substrings.
* options: indicate ambiguous option parameters explicitlyUoti Urpala2011-07-291-6/+8
| | | | | | | | Command line options like "-foo xyz" are ambiguous: "xyz" may be a parameter to the option "foo" or an unrelated argument. Instead of relying on the struct m_config mode field (commandline/file) pass parameters to specify ambiguous mode explicitly. Meant for "--foo" options which are never ambiguous on command line either.
* options: move command line preparse together with parseUoti Urpala2011-07-261-10/+52
|
* cleanup: reformat parser-mpcmd.cUoti Urpala2011-07-261-218/+200
| | | | Also remove some redundant code.
* Delete things related to old translation systemUoti Urpala2010-03-101-1/+0
| | | | | Remove the help/ subdirectory, configure code to create toplevel help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
* Merge svn changes up to r30732Uoti Urpala2010-03-101-3/+1
|\
| * Add header for macosx_finder_args() instead of forward declaring it.diego2010-02-231-3/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30717 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r30475Uoti Urpala2010-03-091-0/+17
|\|
| * Add license header to all top-level files missing them.diego2010-01-301-0/+17
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r29912Uoti Urpala2009-11-161-5/+7
|\|
| * Support the range syntax (like dvd://2-5) also for dvdnav.reimar2009-11-111-5/+7
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29892 b3059339-0415-0410-9bf9-f77b7e298cf2
| * whitespace cosmetics: Remove all trailing whitespace.diego2009-05-131-8/+8
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Remove trailing whitespace from most filesUoti Urpala2009-07-071-8/+8
| |
* | Translation system changes part 2: replace macros by stringsAmar Takhar2009-07-071-5/+5
| | | | | | | | | | Replace all MSGTR_ macros in the source by the corresponding English string.
* | Translation system changes part 1: wrap translated stringsAmar Takhar2009-07-071-5/+5
| | | | | | | | | | Replace mp_msg() calls which have a translated string as the format argument with mp_tmsg and add _() around all other translated strings.
* | Merge svn changes up to r28087Uoti Urpala2008-12-041-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: command.c libao2/ao_ivtv.c libao2/ao_v4l2.c libmpcodecs/dec_video.h libvo/aspect.h libvo/sub.c libvo/sub.h libvo/vo_directx.c libvo/vo_macosx.m libvo/vo_quartz.c mp_core.h mplayer.c mplayer.h osdep/getch2.h osdep/timer.h
| * Get rid of pointless 'extern' keywords.diego2008-12-031-1/+1
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Merge svn changes up to r27441Uoti Urpala2008-08-081-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: cfg-common-opts.h command.c configure input/input.c libmpcodecs/dec_video.c libmpcodecs/vd.c libmpdemux/stheader.h libvo/sub.c libvo/video_out.c libvo/vo_xv.c libvo/vosub_vidix.c libvo/x11_common.c libvo/x11_common.h mp_core.h mplayer.c stream/stream.h
| * Give a CONFIG_ prefix to preprocessor directives that lacked one anddiego2008-08-071-2/+2
| | | | | | | | | | | | | | change arbitrary prefixes to CONFIG_. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27429 b3059339-0415-0410-9bf9-f77b7e298cf2
| * Ahem, the MACOSX_FINDER_SUPPORT directive was renamed to MACOSX_FINDER.diego2008-08-071-2/+2
| | | | | | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27426 b3059339-0415-0410-9bf9-f77b7e298cf2
* | Move global mconfig to mpctxUoti Urpala2008-04-261-3/+5
|/ | | | | | | | | | | The global was used in the function cfg_include which handles the -include option. Make the address available in that function by creating a new dynamically allocated option in m_config_new that has the address in the option's private data. asxparser.c also used the global. Making it available through all ways the code could get called required a number of relatively straightforward changes to playtree and menu code.
* Include some .h files in corresponding .c filesuau2008-03-281-0/+1
| | | | | | | | | Include the corresponding .h file in command.c, parser-cfg.c and parser-mpcmd.c. This allows the compiler to check that the declarations in the .h file match the actual defition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26295 b3059339-0415-0410-9bf9-f77b7e298cf2
* Mark more m_option_t uses as constreimar2007-12-021-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25255 b3059339-0415-0410-9bf9-f77b7e298cf2
* localization of parser-m*cmd.c messagesptt2006-11-271-5/+6
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21328 b3059339-0415-0410-9bf9-f77b7e298cf2
* Doxygen Attack! - Chapter 3albeu2006-04-251-0/+7
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18266 b3059339-0415-0410-9bf9-f77b7e298cf2
* Small fix, incorrect MSGL at fatal errorreynaldo2006-04-221-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18210 b3059339-0415-0410-9bf9-f77b7e298cf2
* also print an error when parsing fails with M_OPT_INVALID or M_OPT_PARSER_ERR.reimar2006-04-191-0/+1
| | | | | | | fixes MPlayer exiting without message for e.g. "mplayer -ao" git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18149 b3059339-0415-0410-9bf9-f77b7e298cf2
* avoid crash when running "mplayer -loop" (dereferencing uninitialize pointer).reimar2006-04-141-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18098 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make -list-options work in both MPlayer and MEncoder.albeu2006-01-241-5/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17473 b3059339-0415-0410-9bf9-f77b7e298cf2
* allow multiple help clauses on the command line, Patch by kiriuja " ↵gpoirier2005-09-021-2/+7
| | | | | | | | | | | | | | | | | mplayer-patches AH en-directo POUM net " This one makes mplayer -vo help -ao help -ac help -vc help -pphelp -af help -vfm help -vf help -afm help -fstype help produce the desired output. From the thread: Date: Jul 16, 2005 8:25 PM Subject: [MPlayer-dev-eng] [PATCH] allow multiple help clauses on the command line git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16346 b3059339-0415-0410-9bf9-f77b7e298cf2
* when somebody specifies e.g. --loop, the message says that a -loop optionreimar2005-06-171-1/+1
| | | | | | | does not exist. So add an extra - to the message. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15743 b3059339-0415-0410-9bf9-f77b7e298cf2
* Make "mplayer -- --a" play the file --a instead of bailing out with a uselessreimar2005-04-231-1/+1
| | | | | | | error message git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15246 b3059339-0415-0410-9bf9-f77b7e298cf2
* Clarify confusing error message.diego2005-01-191-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14542 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix: when doing -loop 0 -shuffle, the arg after shuffle was skippedreimar2004-11-141-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13933 b3059339-0415-0410-9bf9-f77b7e298cf2
* add support for macosx finder argument support (let you bundle mplayer to be ↵nplourde2004-11-101-0/+9
| | | | | | a finder compliant .app) patch by Chris Roccati <roccati@pobox.com> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13910 b3059339-0415-0410-9bf9-f77b7e298cf2
* -use-stdin renamed to -noconsolecontrols.diego2004-07-141-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12817 b3059339-0415-0410-9bf9-f77b7e298cf2
* Support dvd://start_title-end_title as requested on wishlistrtognimp2004-06-071-2/+39
| | | | | | | Patch by adland git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12544 b3059339-0415-0410-9bf9-f77b7e298cf2
* Fail if empty or nonexitant playlistrtognimp2004-04-241-6/+6
| | | | | | | Patch by adland git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12268 b3059339-0415-0410-9bf9-f77b7e298cf2
* 100l to albeu for his english grammar, and 10l to me becouse I noticed that ↵alex2003-08-131-1/+1
| | | | | | lately (my backward compatibilty macro uses M_OPT_UNKNOWN) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10596 b3059339-0415-0410-9bf9-f77b7e298cf2
* Removed the historic cfgparser and switched full to the new config parser ↵alex2003-08-131-5/+0
| | | | | | (altought some macros still remain for compatibility). As a side effect 90% of the warning messages are gone from the core. Things should be cleaner now and less confusing for newbies. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10595 b3059339-0415-0410-9bf9-f77b7e298cf2
* fix the bug where only the last file of the command line is foundpl2003-08-081-8/+8
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10543 b3059339-0415-0410-9bf9-f77b7e298cf2
* c vs c++ syntaxalex2003-08-031-9/+11
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10514 b3059339-0415-0410-9bf9-f77b7e298cf2
* output typo fixes: unknow --> unknowndiego2003-07-091-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10398 b3059339-0415-0410-9bf9-f77b7e298cf2
* Exit when the option parser return M_OPT_EXITalbeu2003-04-021-1/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9793 b3059339-0415-0410-9bf9-f77b7e298cf2
* Remove the hack used to pass -dvd, etc into the playlistalbeu2003-03-301-82/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9748 b3059339-0415-0410-9bf9-f77b7e298cf2
* Ok, firstly fixed the bug in parser-mpcmd.c where itarpi2003-01-261-2/+3
| | | | | | | | | | | would accept a non-interger as an argument for -loop (beginning of cmdline)..and have made it print an error the same as when you pass a non-int to -loop (end of cmdline) (parsed in different places). patch by Alex Sisson <alex_sisson@yahoo.co.uk> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9107 b3059339-0415-0410-9bf9-f77b7e298cf2
* 2*10l=20larpi2002-12-151-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8459 b3059339-0415-0410-9bf9-f77b7e298cf2
* -rnd --> -shufflediego2002-12-151-2/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8453 b3059339-0415-0410-9bf9-f77b7e298cf2
* more i+1<argc checksarpi2002-12-111-3/+4
| | | | | | | patch by "Puk Madick" <pingy@swirvemail.com>, correction by Albeu git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8427 b3059339-0415-0410-9bf9-f77b7e298cf2
* 10l noticed by "Puk Madick" <pingy@swirvemail.com>arpi2002-12-071-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8401 b3059339-0415-0410-9bf9-f77b7e298cf2
* Basic support for random playing (-rnd and -nornd)albeu2002-11-121-0/+14
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8176 b3059339-0415-0410-9bf9-f77b7e298cf2
* New config system + cleanup of header inter dependencyalbeu2002-11-121-0/+284
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8165 b3059339-0415-0410-9bf9-f77b7e298cf2