QB64 Phoenix Edition
To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2)
+--- Thread: To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable (/showthread.php?tid=932)



To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable - mnrvovrfc - 09-29-2022

I've been using Spiral Linux, this one that came about a few weeks ago, which is based on Debian but is a lot like Ubuntu. I chose Cinnamon desktop environment, which is a first for me, similar to MATE but it might be the same for a different "skin" such as GNOME or KDE. Many others based on Debian or Ubuntu should be alike. The "default" profile of the terminal is dark print on light background. If the user doesn't change it to "dark mode", some messages QB64PE compiler gives out might not be readable unless "-m" switch is used to suppress all coloring. What if the user doesn't like "dark mode" for the terminal?

I use "-x" switch a lot because I consider the QB64 "mainwin" bothersome only for compilation and there might be a need to pick up the compiler's error messages into a text file. I think there is an "error log" for this, the same one as for the C++ compilation errors.

Finally there's at least one person that forgets to use "-e", or desires to enable verbose for reasons they have to be asked for.

I suppose things could be run from "-s" switch but it's yet another thing to remember when running the compiler.

Therefore I propose an environment variable, or an INI file loaded only by the compiler, that reads switches to use already if not specified at the command line. Something like "options.bin" but only for the compiler mode of QB64PE executable.

One more thing: the "-m" switch is not listed in the "man" page "qb64pe.1".


RE: To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable - Pete - 09-29-2022

(09-29-2022, 12:34 AM)mnrvovrfc Wrote: I've been using Spiral Linux, this one that came about a few weeks ago, which is based on Debian but is a lot like Ubuntu. I chose Cinnamon desktop environment, which is a first for me, similar to MATE but it might be the same for a different "skin" such as GNOME or KDE. Many others based on Debian or Ubuntu should be alike. The "default" profile of the terminal is dark print on light background. If the user doesn't change it to "dark mode", some messages QB64PE compiler gives out might not be readable unless "-m" switch is used to suppress all coloring. What if the user doesn't like "dark mode" for the terminal?

I use "-x" switch a lot because I consider the QB64 "mainwin" bothersome only for compilation and there might be a need to pick up the compiler's error messages into a text file. I think there is an "error log" for this, the same one as for the C++ compilation errors.

Finally there's at least one person that forgets to use "-e", or desires to enable verbose for reasons they have to be asked for.

I suppose things could be run from "-s" switch but it's yet another thing to remember when running the compiler.

Therefore I propose an environment variable, or an INI file loaded only by the compiler, that reads switches to use already if not specified at the command line. Something like "options.bin" but only for the compiler mode of QB64PE executable.

One more thing: the "-m" switch is not listed in the "man" page "qb64pe.1".

> One more thing: the "-m" switch is not listed in the "man" page "qb64pe.1".

We have a "man" page?

Pete


RE: To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable - mnrvovrfc - 09-29-2022

It's for Linux. Probably for MacOS also since it was also based on Unix. With the "current" directory that of QB64PE open it like this:
Code: (Select All)
man -l qb64pe.1

(that's hyphen and lowercase "L" right after it, means use only the filename following, instead of trying to search through the structure in "/usr/share/man", or worse while you're offline it could try to go online to download a page to display it for you...)

It's a lot like QB64 IDE help pages: text files formatted in a way tailored for a program that displays them pretty.

It's not very much anyway for a Windows user, only describes CLI operation. I don't know if MinGW comes with a "man" program, and it should be an option for Cygwin.


RE: To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable - JRace - 09-29-2022

That manpage (ladies, shield your fair eyes!), qb64pe.1, is included with the Windows compiler as well.  It ain't pretty unless you run it through man2html or something similar.

When 3.2.0 came out I meant to mention that the -f switch was not mentioned in the manpage, but it slipped my mind.

Upon examination, four switches are not listed in the manpage.

Here's a side-by-side of qb64pe.exe's help screen on top of the manpage.  Help screen contents rearranged to match manpage, to make comparison easier:
[Image: 2022-09-28-203107.png]



@mnrvovrfc : man.exe was available as part of msys/mingw last time I set it up, jeez, 5 years ago.  It's part of msys, IIRC.  Dunno if it's still available.  man2html.exe may be more useful to Win users since it can convert manpages to HTML once and for all.  I have a statically-linked copy for Windows and can post it if anyone is interested.


RE: To mimic "cmd.exe" behavior with eg. "DIRCMD" env. variable - mnrvovrfc - 09-29-2022

(09-29-2022, 01:48 AM)JRace Wrote: When 3.2.0 came out I meant to mention that the -f switch was not mentioned in the manpage, but it slipped my mind.
Huh, what does "-f" switch do? Asking because I had to relog, Palemoon browser doesn't finish displaying github pages and therefore couldn't read all of the changelog. Also I'm still on QB64PE v3.1.

EDIT: never mind, this is what happens when I don't see screen shots!

Anyway the real focus of this thread is a proposal to stash switches somewhere (such as an INI file) pre-loaded by QB64PE compiler to save typing on the CLI. Otherwise would need an army of batch files or just "deal with it".