Matt Zimmerman
2004-Sep-10 16:45 UTC
[Flac-dev] flac command line usage (was: the road to 1.0...)
On Tue, May 01, 2001 at 12:28:40PM -0700, Josh Coalson wrote:> OK, I kind of like Matt's usage idea best. I think there are only > two minor downsides: > > 1. You won't be able to do basename renaming within the command > anymore, i.e. 'flac 01.wav songname.flac', you have to do a > 'flac 01.wav && mv 01.flac songname.flac'Or: flac 01.wav - > songname.flac This modification would make flac behave more like gzip, which is a pretty good model of how a unix-style compressor should behave. The addition of a -c option to force output to stdout, and a default input file of stdin would make flac command-line compatible with gzip for basic compression and decompression tasks. Whether or not this is a good idea is another matter.> 2. This one's way out there, but I guess if someone were on DOS then > .flac will be too long and there's no way to get around that unless > I add some option to specify a default extension.Like gzip's -S option? ;-) And/Or, the default extension could be different on DOS than when a real filesystem is available, set at compile time.> So unless there's a really big objection I think I'll go and make > the changes so that the output file name is automatically determined and you > can specify multiple input files.Goodie. Maybe the default decoding output filename should be set based on the -f[urw] flags? So if raw output is selected, the output file would not be named .wav. This is probably unnecessary, though; I imagine most batch compressing/decompressing would be done with WAV. -- - mdz
Matt Zimmerman
2004-Sep-10 16:45 UTC
[Flac-dev] flac command line usage (was: the road to 1.0...)
On Tue, May 01, 2001 at 02:01:04PM -0700, Josh Coalson wrote:> Now, that I've gone to implement it, there's a problem it creates with > piping, that flac doesn't know what to name an output file when the input is > stdin, and there would be no clean way to tell to write a decoded file to > stdout. Any suggestions?The logical thing to do is to output to stdout...what is the complicating factor? Is it because you leave the filenames in argv[]? It's hard to tell at first glance... (while I'm here...why in POSIX's name don't you use getopt(3)? I could gladly supply a patch if you're interested...) -- - mdz
Josh Coalson
2004-Sep-10 16:45 UTC
[Flac-dev] flac command line usage (was: the road to 1.0...)
OK, I have checked in the changes to the command-line handling if anyone wants to try it out. Hopefully it's more intuitive. Also, I added the WAVE autodetection Mark was asking about. The flac usage and documentation.html should be up-to-date also. Josh __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Larry Fenske
2004-Sep-10 16:45 UTC
[Flac-dev] flac command line usage (was: the road to 1.0...)
I may be a bit behind, since I haven't looked at the latest documentation in CVS. My apologies if these problems have already been solved. I think having a default file name is a good idea, but it should be just a default. There should also be a '-o' option to specify the output file name. This option would only apply if there is one input. '-o' should also accept a "file name" of '-' (as in '-o-') to specify stdout. The default output when input is stdin should be stdout. I think this option would solve the four problems listed below. Larry Fenske> > > I think the easiest way to make all of this "just work" would be to > > provide > > > a default output filename for both encoding and decoding, e.g.: > > > > > > flac file.wav > > > > > > would produce file.flac, and > > > > > > flac -d file.flac > > > > > > would produce file.wav. That way, flac *.wav and flac -d *.flac > > are > > possible, > > > and their behavior easily understood. > > > > > > > OK, I kind of like Matt's usage idea best. I think there are only > > two minor downsides: > > > > 1. You won't be able to do basename renaming within the command > > anymore, i.e. 'flac 01.wav songname.flac', you have to do a > > 'flac 01.wav && mv 01.flac songname.flac' > > > > 2. This one's way out there, but I guess if someone were on DOS then > > .flac will be too long and there's no way to get around that unless > > I add some option to specify a default extension. > > > > So unless there's a really big objection I think I'll go and make > > the changes so that the output file name is automatically determined > > and you can specify multiple input files. > > > Now, that I've gone to implement it, there's a problem it creates > with piping, that flac doesn't know what to name an output file > when the input is stdin, and there would be no clean way to tell > to write a decoded file to stdout. Any suggestions? > > Josh
Josh Coalson
2004-Sep-10 16:45 UTC
[Flac-dev] flac command line usage (was: the road to 1.0...)
> > I think the easiest way to make all of this "just work" would be to > provide > > a default output filename for both encoding and decoding, e.g.: > > > > flac file.wav > > > > would produce file.flac, and > > > > flac -d file.flac > > > > would produce file.wav. That way, flac *.wav and flac -d *.flac > are > possible, > > and their behavior easily understood. > > > > OK, I kind of like Matt's usage idea best. I think there are only > two minor downsides: > > 1. You won't be able to do basename renaming within the command > anymore, i.e. 'flac 01.wav songname.flac', you have to do a > 'flac 01.wav && mv 01.flac songname.flac' > > 2. This one's way out there, but I guess if someone were on DOS then > .flac will be too long and there's no way to get around that unless > I add some option to specify a default extension. > > So unless there's a really big objection I think I'll go and make > the changes so that the output file name is automatically determined > and you can specify multiple input files. >Now, that I've gone to implement it, there's a problem it creates with piping, that flac doesn't know what to name an output file when the input is stdin, and there would be no clean way to tell to write a decoded file to stdout. Any suggestions? Josh __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
Josh Coalson
2004-Sep-10 16:45 UTC
[Flac-dev] flac command line usage (was: the road to 1.0...)
> > > It would be easier if FLAC understand the following command:"flac *.wav> > > *.flac" or "flac -d *.flac *.wav" > > > > > > for now I have to use some shell "tricks". > > > > > I assume you're using the DOS shell? because all unix shells Iknow will> > expand the globs first so this syntax cannot work anyway. > > > > but I know what you're saying. something 'flac -d *.flac' would beuseful...> > I'll keep it in mind. > > I think the easiest way to make all of this "just work" would be toprovide> a default output filename for both encoding and decoding, e.g.: > > flac file.wav > > would produce file.flac, and > > flac -d file.flac > > would produce file.wav. That way, flac *.wav and flac -d *.flac arepossible,> and their behavior easily understood. >OK, I kind of like Matt's usage idea best. I think there are only two minor downsides: 1. You won't be able to do basename renaming within the command anymore, i.e. 'flac 01.wav songname.flac', you have to do a 'flac 01.wav && mv 01.flac songname.flac' 2. This one's way out there, but I guess if someone were on DOS then .flac will be too long and there's no way to get around that unless I add some option to specify a default extension. So unless there's a really big objection I think I'll go and make the changes so that the output file name is automatically determined and you can specify multiple input files. Josh __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/