mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-25 12:21:14 -03:00
No need to define "cmd-foo" anchors; use :doc:`foo <cmds/foo>`
instead. If we want "cmd-foo" but it should be tested.
See also 38b24c2325 (docs: Use :doc: role when linking to commands,
2022-09-23).
30 lines
529 B
ReStructuredText
30 lines
529 B
ReStructuredText
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
|