File: fish_is_root_user.rst

package info (click to toggle)
fish 4.2.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 35,980 kB
  • sloc: python: 6,972; javascript: 1,407; sh: 1,009; xml: 411; ansic: 230; objc: 78; makefile: 20
file content (29 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
fish_is_root_user - check if the current user is root
=====================================================

Synopsis
--------

.. synopsis::

    fish_is_root_user

Description
-----------

``fish_is_root_user`` will check if the current user is root. It can be useful
for the prompt to display something different if the user is root, for example.


Example
-------

A simple example:

::

    function example --description 'Just an example'
        if fish_is_root_user
            do_something_different
        end
    end