Re: [Freedos-devel] Toggling directories
Hi Ralph, > On Nov 15, 2022, at 1:26 PM, Ralf Quint wrote: > > On 11/9/2022 7:26 AM, Jerome Shidel wrote: >> Hi all, >> >> There is a minor compatibility difference with the FreeCOM DIR command. >> >> Most of the option switches work like toggles. For example: >> >> dir /w - shows a wide listing >> dir /w /w- shows a normal listing >> dir /w /w /w - shows a wide listing >> >> This deviates from MS-DOS >> >> dir /w - shows a wide listing >> dir /w /w- shows a wide listing >> >> To toggle it back off MS-DOS requires the /-w switch and works fine with the >> FreeCOM DIR. >> >> When used through an alias like “set alias ls=dir /w” then executing “ls /w” >> it produce results different from what is expected. >> >> Not all options perform toggling. For example: >> >> dir /p - pauses per page >> dir /p /p- pauses per page >> >> I don’t think the toggling is very important. But, it does deviant from >> MS-DOS. >> I do think that consistency across the options is important. >> >> Any thoughts? > My thought? You got to be kidding! ;-) > Sorry, just can't see how one could possibly abuse that bug in MS-DOS, and > that is certainly nothing that I would suggest we strive to emulate, > consistency or not... > > > Ralf > Sorry. But, I’m confused by your response. In MS-DOS, DIR does not toggle at all when using simple switches without a +/-. In FreeDOS, most DIR options toggle without using a +/-. Both support turning off/on options when a +/- is used. However, I have not tested all options under both. So, it is possible some may only turn on an option under one or the other OS. Are you saying… You don’t care and we should not worry about it? Or, something else? Although MS-DOS does not do the toggling, it could cause user confusion. So, I’m not sure if FreeDOS should. However, I think DIR should at least be consistent and either all or none of it’s options should support toggling. :-) Jerome ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
On 11/9/2022 7:26 AM, Jerome Shidel wrote: Hi all, There is a minor compatibility difference with the FreeCOM DIR command. Most of the option switches work like toggles. For example: dir /w- shows a wide listing dir /w /w - shows a normal listing dir /w /w /w - shows a wide listing This deviates from MS-DOS dir /w- shows a wide listing dir /w /w- shows a wide listing To toggle it back off MS-DOS requires the /-w switch and works fine with the FreeCOM DIR. When used through an alias like “set alias ls=dir /w” then executing “ls /w” it produce results different from what is expected. Not all options perform toggling. For example: dir /p- pauses per page dir /p /p - pauses per page I don’t think the toggling is very important. But, it does deviant from MS-DOS. I do think that consistency across the options is important. Any thoughts? My thought? You got to be kidding! ;-) Sorry, just can't see how one could possibly abuse that bug in MS-DOS, and that is certainly nothing that I would suggest we strive to emulate, consistency or not... Ralf ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
On Sat, 12 Nov 2022, tom ehlert wrote: maybe even one of our assembler gurus looks at published sources of msdos 2.01 The 2.11 sources won't say anything here, as the DIRCMD stuff wasn't introduced to MS-DOS until 5.0. I checked the behavior with PC DOS 2000 since that was my preferred version and was, in fact, a descendant of MS-DOS 5 (and still supports 99% of Microsoft's quirks). -uso. ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
> In general, I find that toggling options are a bad idea. Things > just get too confusing, especially if you have multiple "sources" > for the options (like combinations of internal/compile-time default > settings, environment variables, options entered through a batch > file, options entered via a command-line, etc.). It just gets too > confusing to keep track of whether in total you've entered an even or odd > number of "toggles". > I usually set up my programs so that there is a +/- or yes/no > "sub-option". Rather than toggling, there is an "override" or > "priority" process of which option to use. For example, an option > provided through an environment variable takes priority over a > default/internal option -- it does not "toggle" the internal option > but rather completely overrides it. Similarly, an option entered on > the command-line takes priority over an option provided through an > environment variable. I find this approach much less confusing than toggling. I agree with your reasoning, but the reasoning is pretty much irrelevant. The rules are made by MS COMMAND.COM, and are most likely (most of the times?) set, not toggle. now I wonder who will verify this, and why did the original author even implement toggling instead of setting. maybe even one of our assembler gurus looks at published sources of msdos 2.01 Tom ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
Hi Bret, > In general, I find that toggling options are a bad idea. Things just > get too confusing, especially if you have multiple "sources" for the > options (like combinations of internal/compile-time default settings, > environment variables, options entered through a batch file, options > entered via a command-line, etc.). It just gets too confusing to keep > track of whether in total you've entered an even or odd number of > "toggles". +1 Cheers, Robert -- BTTR Software https://www.bttr-software.de/ DOS ain't dead https://www.bttr-software.de/forum/ ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
In general, I find that toggling options are a bad idea. Things just get too confusing, especially if you have multiple "sources" for the options (like combinations of internal/compile-time default settings, environment variables, options entered through a batch file, options entered via a command-line, etc.). It just gets too confusing to keep track of whether in total you've entered an even or odd number of "toggles". I usually set up my programs so that there is a +/- or yes/no "sub-option". Rather than toggling, there is an "override" or "priority" process of which option to use. For example, an option provided through an environment variable takes priority over a default/internal option -- it does not "toggle" the internal option but rather completely overrides it. Similarly, an option entered on the command-line takes priority over an option provided through an environment variable. I find this approach much less confusing than toggling. ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
On Fri, 11 Nov 2022, tom ehlert wrote: virtually all options toggle, but someone probably noted that /P should not toggle, because even after set DIRCMD=/P DIR /P should still pause. MSDOS probably has not toggling at all (I'm not sure; someone who is not named Tom should test this), and optScanBool() should be replaced by optScanBool2() all over FreeCOM. Checked with PC DOS 2000: DIR /P/P = page mode is active. SET DIRCMD=/P DIR = page mode is active. SET DIRCMD=/P DIR /P = page mode is active. SET DIRCMD=/P DIR /-P = page mode is not active. DIR /P/-P = page mode is not active. -uso. ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
Hallo Herr Jerome Shidel, am Mittwoch, 9. November 2022 um 16:26 schrieben Sie: > Not all options perform toggling. For example: > dir /p - pauses per page > dir /p /p - pauses per page > I don’t think the toggling is very important. But, it does deviant from > MS-DOS. > I do think that consistency across the options is important. as Aitor said:"To me this is a bug. Not a major one, but a bug." if you look at the source (cmd\dir.c) ... optScanFct(opt_dir) { (void)arg; switch(ch) { case 'S': return optScanBool(optS); case 'P': return optScanBool2(optP); /* multiple uses, /P /P, do not cancel, only /-P */ case 'W': return optScanBool(optW); case 'B': return optScanBool(optB); virtually all options toggle, but someone probably noted that /P should not toggle, because even after set DIRCMD=/P DIR /P should still pause. MSDOS probably has not toggling at all (I'm not sure; someone who is not named Tom should test this), and optScanBool() should be replaced by optScanBool2() all over FreeCOM. Tom ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
Jerome Shidel said: > There is a minor compatibility difference > with the FreeCOM DIR command. > Most of the option switches work like toggles. I prefer the FreeCOM way. ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
Re: [Freedos-devel] Toggling directories
Agreed. To me this is a bug. Not a major one, but a bug. Aitor On Wed, 9 Nov 2022 at 16:28, Jerome Shidel wrote: > Hi all, > > There is a minor compatibility difference with the FreeCOM DIR command. > > Most of the option switches work like toggles. For example: > > dir /w - shows a wide listing > dir /w /w - shows a normal listing > dir /w /w /w - shows a wide listing > > This deviates from MS-DOS > > dir /w - shows a wide listing > dir /w /w - shows a wide listing > > To toggle it back off MS-DOS requires the /-w switch and works fine with > the FreeCOM DIR. > > When used through an alias like “set alias ls=dir /w” then executing “ls > /w” it produce results different from what is expected. > > Not all options perform toggling. For example: > > dir /p - pauses per page > dir /p /p - pauses per page > > I don’t think the toggling is very important. But, it does deviant from > MS-DOS. > I do think that consistency across the options is important. > > Any thoughts? > > :-) > > Jerome > > ___ > Freedos-devel mailing list > Freedos-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/freedos-devel > ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel
[Freedos-devel] Toggling directories
Hi all, There is a minor compatibility difference with the FreeCOM DIR command. Most of the option switches work like toggles. For example: dir /w - shows a wide listing dir /w /w - shows a normal listing dir /w /w /w- shows a wide listing This deviates from MS-DOS dir /w - shows a wide listing dir /w /w - shows a wide listing To toggle it back off MS-DOS requires the /-w switch and works fine with the FreeCOM DIR. When used through an alias like “set alias ls=dir /w” then executing “ls /w” it produce results different from what is expected. Not all options perform toggling. For example: dir /p - pauses per page dir /p /p - pauses per page I don’t think the toggling is very important. But, it does deviant from MS-DOS. I do think that consistency across the options is important. Any thoughts? :-) Jerome ___ Freedos-devel mailing list Freedos-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-devel