2

I try to get the Windows command line to show MinGW64 online help manual on Windows 10 Pro 64-bit, similar to the command "man command_name" executed in a Linux terminal (which shows verbose online manual help for the stated command_name as seen here @1.42).

GCC has been added to the environment variable PATH and is available globally.
However on doing a gcc --help in both a Windows command prompt window or a PowerShell console, no "man" command is available for Windows.
I tried also using other help commands like:

gcc --help command_name  
gcc --help "command_name"  

gcc --target-help command_name
gcc --target-help "command_name"    

gcc --help = {command_name}
gcc --help = {"command_name"}

But output is always the error message:

gcc: error: command_name : No such file or directory

MinGW64 reference docs do not provide any sample code.

How to get the help manual from the command line in Windows cmd / PowerShell?

Mofi
  • 46,139
  • 17
  • 80
  • 143
srt111
  • 1,079
  • 11
  • 20
  • The help output with `gcc --help` shows how to get help for a specific set of options by using `gcc --help=` and one of the keywords like `common` or `optimizers` or `params` or `target` or `warnings`, etc. The `man` feature is not available on Windows. This is a Linux feature as explained by [Antares](https://stackoverflow.com/users/13399971/antares). – Mofi Apr 28 '20 at 06:05

1 Answers1

4

Short answer: Sadly there is no man under Windows.

For programming reference, you need to find your information sources online and use the browser as the guy in the video uses his linux shell.

I for one, always have a browser open on the second monitor while programming for example. Probably because I am not used to have a shell with extensive "man" functions available. The shell (cmd.exe) is used for invoking maven build and other functions/scripts mainly.

There might be plugins for Eclipse (or any other IDE like IntelliJ Idea) that allow you to include those web sources into the IDE. Maybe even for offline use.
Then you could for example hit "Shift-F1" on a keyword and the help pops up inside a window or the browser. I do not have any plugin names at hand for you, though. You need to figure that out with your favorite search engine.

There is a well written answer to a rephrasing of your question: "What is the equivalent of man under Windows" (TL;DR: There is help <internal cmd.exe command> or <command/executable> /? or /h or similar, depends on the executable, but neither is equivalent to man).
However, the answer is six years old. And there is one interesting move in the Windows world in the meantime which is not covered: The "Windows Subsystem for Linux" (WSL). You might get the man pages to work with that, but I haven't tried this.
This would of course just give the Linux specific man pages, not something for any Windows commands. You could even use Cygwin for that. This topic is covered in another article: Where is the 'man' Program for Windows (Program to open UNIX man pages)?.

Antares
  • 605
  • 3
  • 14
  • The problem with Gcc online docs (https://gcc.gnu.org/onlinedocs/gcc-8.4.0/gcc/) is that it is does not provide all the commands (eg "pthreads" which is readily accessed in the above video is not even available in the docs).It would be really helpful to find a complete manual of Mingw64 commands to save time and frustration.The most helpful thing in such a case would be to access command line "help"(tried in question) to atleast get an idea of what these commands do .(I am using Vscode and it doesn't seem to have any additional support ,other than invoking help from the gcc commandline ) – srt111 Apr 28 '20 at 00:57
  • @starzar The [POSIX threads](https://en.wikipedia.org/wiki/POSIX_Threads) are a set of types and functions stored in the __library__ `pthread` and not a "command" of GCC. Windows does not support the __pthreads__ standard natively. – Mofi Apr 28 '20 at 05:54
  • @starzar I recommend to bookmark in your browser [The C++ Resources Network](https://www.cplusplus.com/) if you need help on language keywords of C/C++, the standard types and the types, macros and functions defined in standard C/C++ libraries. – Mofi Apr 28 '20 at 06:18
  • 1
    @starzar The [Linux man pages](https://linux.die.net/man/) are available also online if you prefer to use them on Windows although written for Linux. – Mofi Apr 28 '20 at 06:27