Commit Graph

57 Commits

Author SHA1 Message Date
Uoti Urpala 081e2d0b7b options: commandline: support "--no-opt" for flag options
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).
2011-09-01 18:32:11 +03:00
Uoti Urpala ce9ce9d0c3 options: commandline: don't set bogus playtree option params
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.
2011-07-31 01:19:13 +03:00
Uoti Urpala ad48f8038c options: commandline: print error type for parse failures
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".
2011-07-29 07:58:56 +03:00
Uoti Urpala 5d5ca22a6d options: commandline: accept --foo=xyz style options
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").
2011-07-29 07:24:09 +03:00
Uoti Urpala 0010ffefc4 options: commandline: allow "--" without filenames after it
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.
2011-07-29 05:50:38 +03:00
Uoti Urpala e873d703e9 options: change option parsing to use bstr
Using bstr allows simpler parsing code, especially because it avoids
the need to modify or copy strings just to terminate extracted
substrings.
2011-07-29 05:50:38 +03:00
Uoti Urpala 507fa7e2c2 options: indicate ambiguous option parameters explicitly
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.
2011-07-29 05:02:05 +03:00
Uoti Urpala ea4cc89f36 options: move command line preparse together with parse 2011-07-26 06:02:03 +03:00
Uoti Urpala 02b99bd5ba cleanup: reformat parser-mpcmd.c
Also remove some redundant code.
2011-07-26 04:28:37 +03:00
Uoti Urpala 00323c06e2 Delete things related to old translation system
Remove the help/ subdirectory, configure code to create toplevel
help_mp.h, and all the '#include "help_mp.h"' lines from .c files.
2010-03-10 03:47:14 +02:00
Uoti Urpala acdce0176a Merge svn changes up to r30732 2010-03-10 01:25:15 +02:00
Uoti Urpala 12d3caebc7 Merge svn changes up to r30475 2010-03-09 19:18:43 +02:00
diego 5405958e34 Add header for macosx_finder_args() instead of forward declaring it.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30717 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-02-23 07:54:10 +00:00
diego 99c1bbca2a Add license header to all top-level files missing them.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-30 23:24:23 +00:00
Uoti Urpala 287b62163e Merge svn changes up to r29912 2009-11-16 07:01:46 +02:00
reimar 92ac5a8c20 Support the range syntax (like dvd://2-5) also for dvdnav.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29892 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-11 09:03:39 +00:00
Uoti Urpala 0eb321bf2c Remove trailing whitespace from most files 2009-07-07 02:34:35 +03:00
Amar Takhar e306174952 Translation system changes part 2: replace macros by strings
Replace all MSGTR_ macros in the source by the corresponding English
string.
2009-07-07 01:38:20 +03:00
Amar Takhar b5972d6f14 Translation system changes part 1: wrap translated strings
Replace mp_msg() calls which have a translated string as the format
argument with mp_tmsg and add _() around all other translated strings.
2009-07-07 01:28:07 +03:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
Uoti Urpala 8c144171bb Merge svn changes up to r28087
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
2008-12-04 01:55:52 +02:00
diego 0864f92e7a Get rid of pointless 'extern' keywords.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-12-03 23:01:03 +00:00
Uoti Urpala 17d3e4b36d Merge svn changes up to r27441
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
2008-08-08 02:13:09 +03:00
diego e0b1c9a6b7 Give a CONFIG_ prefix to preprocessor directives that lacked one and
change arbitrary prefixes to CONFIG_.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27429 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-07 12:20:50 +00:00
diego 5641e60698 Ahem, the MACOSX_FINDER_SUPPORT directive was renamed to MACOSX_FINDER.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27426 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-08-07 10:57:40 +00:00
Uoti Urpala fb33e286b5 Move global mconfig to mpctx
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.
2008-04-26 10:44:59 +03:00
uau 03bb309e4e Include some .h files in corresponding .c files
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
2008-03-28 01:07:59 +00:00
reimar 8373b55173 Mark more m_option_t uses as const
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25255 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-12-02 15:46:44 +00:00
ptt c846ef4a98 localization of parser-m*cmd.c messages
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21328 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-27 15:46:36 +00:00
albeu 400a9fab2e Doxygen Attack! - Chapter 3
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18266 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-25 01:26:10 +00:00
reynaldo 889eedb39e Small fix, incorrect MSGL at fatal error
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18210 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-22 21:30:34 +00:00
reimar 5c332bb395 also print an error when parsing fails with M_OPT_INVALID or M_OPT_PARSER_ERR.
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
2006-04-19 15:50:37 +00:00
reimar 86acb156cf avoid crash when running "mplayer -loop" (dereferencing uninitialize pointer).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18098 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-04-14 21:51:45 +00:00
albeu 7f28974433 Make -list-options work in both MPlayer and MEncoder.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17473 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-01-24 11:34:24 +00:00
gpoirier 43844d090c allow multiple help clauses on the command line, Patch by kiriuja " 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
2005-09-02 08:29:30 +00:00
reimar c6e32e91b1 when somebody specifies e.g. --loop, the message says that a -loop option
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
2005-06-17 08:11:56 +00:00
reimar 1390092640 Make "mplayer -- --a" play the file --a instead of bailing out with a useless
error message


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15246 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-04-23 20:41:19 +00:00
diego 6974dfae6b Clarify confusing error message.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14542 b3059339-0415-0410-9bf9-f77b7e298cf2
2005-01-19 18:24:53 +00:00
reimar 8fb512dbf0 fix: when doing -loop 0 -shuffle, the arg after shuffle was skipped
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13933 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-11-14 11:09:56 +00:00
nplourde 2cc1ec3ea4 add support for macosx finder argument support (let you bundle mplayer to be 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
2004-11-10 16:43:40 +00:00
diego de22e52855 -use-stdin renamed to -noconsolecontrols.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12817 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-07-14 09:27:04 +00:00
rtognimp 1d0ac71ae8 Support dvd://start_title-end_title as requested on wishlist
Patch by adland


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12544 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-06-07 18:58:08 +00:00
rtognimp a6cf371922 Fail if empty or nonexitant playlist
Patch by adland


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12268 b3059339-0415-0410-9bf9-f77b7e298cf2
2004-04-24 13:15:31 +00:00
alex 1c4586e8f9 100l to albeu for his english grammar, and 10l to me becouse I noticed that lately (my backward compatibilty macro uses M_OPT_UNKNOWN)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10596 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-08-13 16:45:02 +00:00
alex 2283b6305f Removed the historic cfgparser and switched full to the new config parser (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
2003-08-13 16:29:32 +00:00
pl 8ab25e100d fix the bug where only the last file of the command line is found
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10543 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-08-08 20:07:38 +00:00
alex 2124a9a36f c vs c++ syntax
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10514 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-08-03 17:42:43 +00:00
diego 8838b4afa6 output typo fixes: unknow --> unknown
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@10398 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-07-09 01:30:24 +00:00
albeu c193b910c0 Exit when the option parser return M_OPT_EXIT
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9793 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-04-02 16:13:16 +00:00
albeu 27d79717d4 Remove the hack used to pass -dvd, etc into the playlist
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9748 b3059339-0415-0410-9bf9-f77b7e298cf2
2003-03-30 17:08:35 +00:00