manpage

Generating python CLI man page

倖福魔咒の 提交于 2019-11-29 08:04:45
问题 I am developing a python CLI tool (using optparse in python2.6, but hope to switch soon to python2.7) and I am about to write the man page. I have some experience on generating dynamic man pages by: creating a dedicated method that composes a string in pod format and writes it to a file executing the pod2man command to generate data in groff format to be passed to the man command I would also like to generate wiki pages with the same content as the man page (with pod I can generate html

Is there a specification for a man page's SYNOPSIS section?

旧巷老猫 提交于 2019-11-28 17:29:44
I'm trying to write some specifications to be shared between a small team and getting picky about the format I put some command listings in. Is there any formal definition of the syntax used in the SYNOPSIS section of man pages? From the Wikimedia Commons, here's an example of a man page with the SYNOPSIS section I'm talking about, where the command is listed with the required and optional arguments it understands. There is no formal definition of a manpage anywhere, not even in the POSIX standard. The man(1) manpage in your example is pretty typical: you write out the various ways a program

strcmp() return different values for same string comparisons

一曲冷凌霜 提交于 2019-11-28 07:30:23
问题 char s1[] = "0"; char s2[] = "9"; printf("%d\n", strcmp(s1, s2)); // Prints -9 printf("%d\n", strcmp("0", "9")); // Prints -1 Why do strcmp returns different values when it receives the same parameters ? Those values are still legal since strcmp's man page says that the return value of strcmp can be less, greater or equal than 0, but I don't understand why they are different in this example. 回答1: I assume you are using GCC when compiling this, I tried it on 4.8.4. The trick here is that GCC

Set local environment variables in C++

半世苍凉 提交于 2019-11-28 06:43:57
How do I set an environment variable in C++? They do not need to persist past program execution They only need to be visible in the current process Preference for platform independent but for my problem only needs to work on Win32/64 Thanks alamar NAME putenv - change or add an environment variable SYNOPSIS #include &ltstdlib.h> int putenv(char *string); DESCRIPTION The putenv() function adds or changes the value of environment variables. The argument string is of the form name=value. If name does not already exist in the environment, then string is added to the environment. If name does exist

Specific man page for shell built-in commands like 'source'

笑着哭i 提交于 2019-11-28 01:49:39
问题 If you execute any of the following in the command line man source man readonly man suspend ... The output is the same manpage describing shell built-in commands in general. I've searched for 'source' on line and I've found this more specific documentation: Linux / Unix Command: source Command Library NAME source - Evaluate a file or resource as a Tcl script SYNOPSIS source fileName source -rsrc resourceName ?fileName? source -rsrcid resourceId ?fileName? How can I output something similar in

Linux/Unix man page syntax conventions

旧巷老猫 提交于 2019-11-27 11:43:21
In man pages I come across various syntaxes to write Linux/Unix commands, which include square brackets, angular brackets, hyphens ( - ) and double hyphens ( -- ) in various combinations. Does anyone know the meaning of these syntax conventions? [ ] < > [< >] [--] - -- [< >...] Avi Square Brackets [ ] The square brackets ( [ ] ) indicate that the enclosed element (parameter, value, or information) is optional. You can choose one or more items or no items. Do not type the square brackets themselves in the command line. Example: [global options], [source arguments], [destination arguments] Angle

What's the difference between “C system calls” and “C library routines”?

烂漫一生 提交于 2019-11-27 06:45:47
There are multiple sections in the manpages. Two of them are: 2 Unix and C system calls 3 C Library routines for C programs For example there is getmntinfo(3) and getfsstat(2) , both look like they do the same thing. When should one use which and what is the difference? System calls are operating system functions, like on UNIX, the malloc() function is built on top of the sbrk() system call (for resizing process memory space). Libraries are just application code that's not part of the operating system and will often be available on more than one OS. They're basically the same as function calls

Where are the man pages for C++? [closed]

折月煮酒 提交于 2019-11-27 06:35:36
Does documentation for C++ exist in Linux? I want something like the man pages of C. For example, docs for string, stl, iostream, ifstream, etc.? Matteo Italia If you use the "normal" libstdc++ shipped with g++, its documentation is available online here . Most Linux distributions make it also available offline as a particular package; for Debian-derived distros, for example, it's libstdc++-6-<version>-doc (e.g. on my Ubuntu machine I have libstdc++-6-4.4-doc installed). In general the documentation will be put somewhere like /usr/share/doc/libstdc++-6-4.4-doc . This about implementation

Set local environment variables in C++

ぃ、小莉子 提交于 2019-11-27 01:28:04
问题 How do I set an environment variable in C++? They do not need to persist past program execution They only need to be visible in the current process Preference for platform independent but for my problem only needs to work on Win32/64 Thanks 回答1: NAME putenv - change or add an environment variable SYNOPSIS #include &ltstdlib.h> int putenv(char *string); DESCRIPTION The putenv() function adds or changes the value of environment variables. The argument string is of the form name=value. If name

Is there a specification for a man page's SYNOPSIS section?

…衆ロ難τιáo~ 提交于 2019-11-27 00:35:37
问题 I'm trying to write some specifications to be shared between a small team and getting picky about the format I put some command listings in. Is there any formal definition of the syntax used in the SYNOPSIS section of man pages? From the Wikimedia Commons, here's an example of a man page with the SYNOPSIS section I'm talking about, where the command is listed with the required and optional arguments it understands. 回答1: There is no formal definition of a manpage anywhere, not even in the