-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
player/command: implement skippable arguments in commands
Optional arguments already exist, but they're not exactly skippable. If you exclude one of these arguments, everything else afterwards also needs to be excluded. In c678033, the arguments of loadfile were changed so a new index argument (optional) must always exist before you can pass the options argument. This naturally breaks the old syntax and to be fair, it is a bit weird to do something like "loadfile file.mkv append -1 options=value". So let's make the old commands compatibile again by making the index argument skippable and adding functionality to support this. The actual command itself (cmd_loadfile) is responsible for handling this sanely.
- Loading branch information
1 parent
c8f1c82
commit bc6d551
Showing
4 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,7 @@ struct mp_cmd_arg { | |
char **str_list; | ||
void *p; | ||
} v; | ||
bool skipped; | ||
}; | ||
|
||
typedef struct mp_cmd { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters