From aa96b7897b40bf1171f08d77e229ec57b2c4119a Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sun, 12 Jan 2014 23:28:55 +0100 Subject: Documentation: Denote command lines with "$" Add a prompt sign to all command lines in code blocks. diff --git a/web/input/doc/extra-opts.md b/web/input/doc/extra-opts.md index 91a205b..06fc5b7 100644 --- a/web/input/doc/extra-opts.md +++ b/web/input/doc/extra-opts.md @@ -21,22 +21,22 @@ Some examples: * Read `special_opts` section of default config file: - ./check_stuff --extra-opts=special_opts + $ ./check_stuff --extra-opts=special_opts * Read `special_opts` section of `/etc/myconfig.ini`: - ./check_stuff --extra-opts=special_opts@/etc/myconfig.ini + $ ./check_stuff --extra-opts=special_opts@/etc/myconfig.ini * Read `check_stuff` section of `/etc/myconfig.ini`: - ./check_stuff --extra-opts=@/etc/myconfig.ini + $ ./check_stuff --extra-opts=@/etc/myconfig.ini * Read `check_stuff` section of default config file and use additional arguments along with the other specified arguments (*extra-opts* arguments are always processed first no matter where `--extra-opts` appears on the command line): - ./check_stuff --extra-opts -jk --some-other-opt + $ ./check_stuff --extra-opts -jk --some-other-opt The default nagios plugins file is used if no explicit filename is given. The current standard locations checked are: diff --git a/web/input/doc/faq/build-perl-module.md b/web/input/doc/faq/build-perl-module.md index 0ec97ac..8c6f2ac 100644 --- a/web/input/doc/faq/build-perl-module.md +++ b/web/input/doc/faq/build-perl-module.md @@ -6,7 +6,7 @@ parent: FAQ This is currently an optional setting at configure time. You need to run: - ./configure --enable-perl-modules + $ ./configure --enable-perl-modules Then, `make`, `make` `install`, `make` `test`, and `make` `clean` will include the Perl modules that are in the `perlmods/` directory as expected. They are diff --git a/web/input/doc/faq/compilation.md b/web/input/doc/faq/compilation.md index b58566a..ac5fff7 100644 --- a/web/input/doc/faq/compilation.md +++ b/web/input/doc/faq/compilation.md @@ -6,10 +6,10 @@ parent: FAQ To compile version `1.x` of the plugins, you run: - gzip -dc nagios-plugins-1.x.tar.gz | tar -xf - - cd nagios-plugins-1.x - ./configure - make + $ gzip -dc nagios-plugins-1.x.tar.gz | tar -xf - + $ cd nagios-plugins-1.x + $ ./configure + $ make You can then [install the plugins][installation]. diff --git a/web/input/doc/faq/git.md b/web/input/doc/faq/git.md index 5503166..390b87a 100644 --- a/web/input/doc/faq/git.md +++ b/web/input/doc/faq/git.md @@ -43,12 +43,12 @@ repository, and until you want to distribute your change or merge changes from someone else, everything that follows can happen offline. If you have push access to the Nagios Plugins repository, run the command: - git clone git@github.com:nagios-plugins/nagios-plugins.git + $ git clone git@github.com:nagios-plugins/nagios-plugins.git If you just want a local copy or wish to clone it to your workstation, you can run this command instead: - git clone git://github.com/nagios-plugins/nagios-plugins.git + $ git clone git://github.com/nagios-plugins/nagios-plugins.git This will create a directory called `nagios-plugins` with all the `master` code and history (this is roughly equivalent to CVS/SVN `HEAD`). Change @@ -58,7 +58,7 @@ directory to `nagios-plugins`. You can edit the files in the working area. To check the status, use: - git status + $ git status This will show a list of changes in the working directory. Newly made changes appear in red, while changes added to the index are shown in green. You can @@ -74,7 +74,7 @@ will add the changes to the index. You can select only partial diffs with difference between HEAD and the index) with **git diff --staged**, and then commit them with: - git commit + $ git commit Add a comment (you *have* read the [Development Guidelines][guidelines], right? :-)). This commit will be local (affecting only your own repository), @@ -83,7 +83,7 @@ you (in the latter case you will most likely still push to a publicly accessible clone of your local repository). If the change is from a contributor, set the author at commit time: - git commit --author="Jane Doe " + $ git commit --author="Jane Doe " If you realize that you forgot something in your commit and haven’t pushed it yet to a remote repository, you can amend your last commit with **git commit @@ -97,18 +97,18 @@ You can revert local modifications with the following steps. First, if you have already staged the changes you will have to unstage them. As indicated in the **git status** message you can do so with the following command: - git reset HEAD + $ git reset HEAD Then you can revert unstaged changes with: - git checkout + $ git checkout If you have already committed changes locally and need to undo your commit(s), you can use **git reset**. First find the commit names with **git log** and then do either one of these: To keep local modifications (you can commit them again, stash them, etc.) - git reset --soft + $ git reset --soft Note that for the purpose of “re-doing” the last commit, **git commit --amend** will be much easier than a reset/commit with the same end result. @@ -116,7 +116,7 @@ To discard local modifications (if you lose important changes with this command you may be able to recover them with **git reflog** and **git checkout **): - git reset --hard + $ git reset --hard Do not reset changes that have already been pushed to remote repositories as this will cause non-linear updates. If you do so, all developers using those @@ -131,14 +131,14 @@ If you do, either commit them or put them aside (hint: **git stash**). If you cloned from the main Git repository, this command will do a fetch and then merge any new changes: - git pull + $ git pull You can also merge changes from any other fork of the repository. This usually happens if someone asks you to pull from his own repo for some fix or enhancements. Together with **--no-commit**, you will have a chance to review the changes and make any relevant correction before the merge. Example: - git pull --no-commit git://example.com/path/to/repo.git master + $ git pull --no-commit git://example.com/path/to/repo.git master ## Merging Back to the Main Repository @@ -146,7 +146,7 @@ Once you’re done with your commits, and after pulling from the main repository, you can push your changes back to it. If you cloned using the *push* URL, this command will push the master branch: - git push + $ git push It you’re trying to push something that would generate merge conflicts, the push will be rejected. You will have to do a pull first, fix any conflicts @@ -154,7 +154,7 @@ locally, and then push again. If your commits are local (you haven’t pulled them from someone else or published them somewhere) you can rebase to avoid a merge: - git pull --rebase + $ git pull --rebase Like a merge, this may generate conflicts and let you fix them, but instead of creating a merge commit on top of the others, it will undo your commits, diff --git a/web/input/doc/faq/gnulib.md b/web/input/doc/faq/gnulib.md index 328dfeb..5b7299b 100644 --- a/web/input/doc/faq/gnulib.md +++ b/web/input/doc/faq/gnulib.md @@ -8,27 +8,27 @@ parent: FAQ not available on all (Unix-like) operating systems. In order to sync with the latest Gnulib code, do something like: - git clone git://git.savannah.gnu.org/gnulib.git - cd gnulib - GNULIB_HEAD=$(git rev-parse --short HEAD) - cd .. - git clone git@github.com:nagios-plugins/nagios-plugins.git - cd nagios-plugins - ../gnulib/gnulib-tool --update - find gl -name '*~' -o -name '.gitignore' | xargs rm - git status - git add gl - git commit -m "Sync with latest Gnulib code ($GNULIB_HEAD)" + $ git clone git://git.savannah.gnu.org/gnulib.git + $ cd gnulib + $ GNULIB_HEAD=$(git rev-parse --short HEAD) + $ cd .. + $ git clone git@github.com:nagios-plugins/nagios-plugins.git + $ cd nagios-plugins + $ ../gnulib/gnulib-tool --update + $ find gl -name '*~' -o -name '.gitignore' | xargs rm + $ git status + $ git add gl + $ git commit -m "Sync with latest Gnulib code ($GNULIB_HEAD)" In order to make a given function available via Gnulib (on systems which don't provide that function), the [corresponding module][modules] must be imported using `gnulib-tool`, e.g. (in order to add the `strcase` module): - ../gnulib/gnulib-tool --no-vc-files --import strcase - find gl -name '*~' | xargs rm - git status - git add gl - git commit -m 'Add Gnulib module "strcase"' + $ ../gnulib/gnulib-tool --no-vc-files --import strcase + $ find gl -name '*~' | xargs rm + $ git status + $ git add gl + $ git commit -m 'Add Gnulib module "strcase"' [gnulib]: http://www.gnu.org/software/gnulib/ "Gnulib" [modules]: http://www.gnu.org/software/gnulib/MODULES.html "Gnulib Modules" diff --git a/web/input/doc/faq/installation.md b/web/input/doc/faq/installation.md index f426f35..6f3694a 100644 --- a/web/input/doc/faq/installation.md +++ b/web/input/doc/faq/installation.md @@ -7,7 +7,7 @@ parent: FAQ After [compiling][compilation] the plugins, you can run the following command to install them: - make install + $ make install [compilation]: doc/faq/compilation.html "Compilation" diff --git a/web/input/doc/faq/libtap.md b/web/input/doc/faq/libtap.md index 29cd357..c592030 100644 --- a/web/input/doc/faq/libtap.md +++ b/web/input/doc/faq/libtap.md @@ -10,10 +10,10 @@ tests are in `lib/tests/test_*.c`. The latest libtap version is currently 1.01. However, there is a bug with the thread implementation. To workaround, run: - CPPFLAGS="-UHAVE_LIBPTHREAD" ./configure - make - make check - make install + $ CPPFLAGS="-UHAVE_LIBPTHREAD" ./configure + $ make + $ make check + $ make install Now when you run the Nagios Plugins `./configure` script, it should find the libtap library and compile the tests and run them when you run `make` `test`. diff --git a/web/input/doc/faq/nagiosmib.md b/web/input/doc/faq/nagiosmib.md index b2f34ae..13fcb9d 100644 --- a/web/input/doc/faq/nagiosmib.md +++ b/web/input/doc/faq/nagiosmib.md @@ -14,7 +14,7 @@ To develop, the requirements are: On Debian, you'd run: - apt-get install smistrip smitools + $ apt-get install smistrip smitools If you get errors like: diff --git a/web/input/doc/faq/ownership.md b/web/input/doc/faq/ownership.md index 58bc311..7fb8ca8 100644 --- a/web/input/doc/faq/ownership.md +++ b/web/input/doc/faq/ownership.md @@ -15,7 +15,7 @@ also installed with the install user's owner and group permissions. If you run: - make install-root + $ make install-root This will set permissions to root, assuming you are either root or using fakeroot. If not, the setuid bit is still set, but the plugin may not work diff --git a/web/input/doc/faq/root-plugins.md b/web/input/doc/faq/root-plugins.md index b5db74d..43994de 100644 --- a/web/input/doc/faq/root-plugins.md +++ b/web/input/doc/faq/root-plugins.md @@ -15,7 +15,7 @@ message will appear: To install, run as root: - make install-root + $ make install-root Even if you are not root, the plugins will still be installed. This is for packagers which can then alter the permissions of the plugins before -- cgit v0.10-9-g596f