Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
5th September 2009, 21:47 | #1 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
DGIndex CLI suggestion
I thought about supporting file names containing commas and had three ideas how to add support:
1.) setting delimiter similar to -SD= 2.) After the commandline was parsed with the current parsing, loop through the arguments, check if the argument is a supported source file and add it as source file if so. The advantage of this method is shell support which is clearly important. Another argument for this method is it's common and good practice that input or output file arguments are passed without a switch. 3.) I wonder why semicolon isn't used as separator, the command shell documentation says, both comma and semicolon are used as separator for commands. It might be possible to support semicolon without breaking backward compatibility. It would check for semicolon, if there is non it's not clear if it's one file containing a comma or more than one file separated by comma. It's easy to find out which case is true, before splitting by comma making a file exist check. I'm not a experienced C++ programmer but certainly experienced enough to make a patch so please let me know how I can help.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 5th September 2009 at 21:49. |
5th September 2009, 22:08 | #2 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
It's all about backward compatibility.
My idea would be to implement a full proper UNIX-like syntax but signal it with an option: DGIndex -u ...sensible UNIX-like syntax for remaining args... If the -u is absent, old parsing is used. If it is present, the new sensible UNIX-like parsing is used. Note that I did not design the current syntax! |
5th September 2009, 23:40 | #3 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Unix like would be a clear improvement, how can I help?
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
5th September 2009, 23:55 | #5 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
You mean the documentation?
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
5th September 2009, 23:59 | #6 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
I mean specify the mapping of existing syntax to proposed UNIX syntax. That would certainly form the basis of the documentation.
The new syntax would obviously allow for commas in filenames, etc. Hopefully it would allow for use of a standard parsing package. |
6th September 2009, 11:31 | #7 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
1:1 mapping not changing any switch would be:
Code:
Set Delimiter -SD=delimiter character obsolete Input Files -IF=[file1,file2,...] -if file1 file2 ... Auto-Input Files -AIF=[file1] -aif file1 Batch Files -BF=[filelist] -bf filelist Project Range -RG=f1/off1/f2/off2 -rg f1/off1/f2/off2 Audio PID -AP=audioPID -ap audioPID Video PID -VP=videoPID -vp videoPID PCR PID -PP=pcrPID -pp pcrPID iDCT Algorithm -IA=algorithm -ia algorithm Field Operation -FO=field operation -fo field operation YUV->RGB -YR=method -yr method Track Number -TN=track(s) -tn track(s) Output Method -OM=method -om method Dynamic Range Control -DRC=amount -drc amount Dolby Surround Downmix -DSD=on/off -dsd on/off Downsample Audio -DSA=method -dsa method Output File -OF=[project file] -of project file Output File and Demux -OFD=[project file] -ofd project file AVS Script Generation -AT=[AVS template file] -at "AVS template file" Exit -EXIT -exit Minimize -MINIMIZE -minimize Hide -HIDE -hide Preview -PREVIEW -preview Would the new CLI give a error message for unrecognized switches? Currently integers are used as arguments to switches, what do you think about using strings instead? What is 'standard parsing package' btw.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 6th September 2009 at 11:51. |
6th September 2009, 13:07 | #8 | Link | |||
Guest
Join Date: Jan 2002
Posts: 21,901
|
Quote:
Quote:
Quote:
http://www.gnu.org/s/libc/manual/html_node/Getopt.html |
|||
6th September 2009, 13:38 | #9 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
DRC for instance has the options off, light, normal, heavy so using strings here would look like:
-drc normal It makes only sense using simple and short words so it's not suitable for switches with more complex options.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
8th September 2009, 22:57 | #12 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
I implemented my own parser so I can use it elsewhere without GPL concerns.
@stax76 I have it all ready to go. Just one question before I give it to you for testing. Do you need the AIF function? I prefer to omit it if possible in the UNIX-STYLE cli. |
8th September 2009, 23:31 | #13 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Awesome. I don't need AIF. Regarding how to decide if the old or new syntax is present, it should be easy to detect this with a simple function like this:
Code:
Function IsOldSyntax(ByVal commandLine As String) As Boolean Dim oldSwitches = "-aa= -bb= -cc=".Split(" ") For Each i In oldSwitches If commandLine.ToLower.Contains(i.ToLower) Then Return True End If Next End Function
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 8th September 2009 at 23:34. |
9th September 2009, 03:06 | #14 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
DGIndex 1.5.6 beta 1
Here is DGIndex 1.5.6 beta 1. It adds the new optional CLI syntax and is now compiled with Visual Studio 8. The zip file contains a description of the new CLI syntax. Note that it is also fully compatible with the old syntax.
http://neuron2.net/dgmpgdec/dgindex156b1.zip Test results and any suggestions will be appreciated. |
9th September 2009, 04:39 | #15 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Works fine , I noticed a log file I've not seen before, maybe you can add a switch to define it's location though it can easily be moved by an fronted (fronteds usually put every file they create in a temporary directory).
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists Last edited by stax76; 9th September 2009 at 04:44. |
9th September 2009, 05:04 | #17 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
It was in the source dir I think, output dir is perfect but frondends also create log files and use numerous applications and many create even more log files so confusion and conflicts can be avoided by using a file name containing the name of the application created the log file or the purpose of the log file, example: *_DGIndex.log.
__________________
https://github.com/stax76/software-list https://www.youtube.com/@stax76/playlists |
9th September 2009, 05:06 | #18 | Link |
Guest
Join Date: Jan 2002
Posts: 21,901
|
But nothing has changed viz-a-viz the log file. Why is it suddenly not acceptable? I've never heard one complaint of collisions or confusion. And don't forget normal invocation also makes log files, so if this was a real issue surely we'd have heard a report about it. Don't get me wrong, I appreciate suggestions, but they need to have some basis in actual experience, because I have limited time for coding.
BTW, -of is changing to -o, and -ofd to -od. Last edited by Guest; 9th September 2009 at 05:10. |
9th September 2009, 07:09 | #19 | Link |
HDConvertToX author
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
|
-AIF is still a useful options. Very handy for automatic loading of vobs (and used in many GUI using DGIndex)
i hope -AIF will be present in future update BHH
__________________
HDConvertToX: your tool for BD backup MultiX264: The quick gui for x264 AutoMen: The Mencoder GUI AutoWebM: supporting WebM/VP8 |
Thread Tools | Search this Thread |
Display Modes | |
|
|