summaryrefslogtreecommitdiff
path: root/scripts/xdg-su
diff options
context:
space:
mode:
authorWaldo Bastian <waldo.bastian@intel.com>2006-06-15 00:44:19 +0000
committerWaldo Bastian <waldo.bastian@intel.com>2006-06-15 00:44:19 +0000
commit8cbf5169ec50e15872aeb73006689bdd5afe7007 (patch)
treeea873509516b42d4b6bb4f0a3d1b03485f9bf742 /scripts/xdg-su
parent1a7591e6f1f0097ab54dc42894f12c2132264c2d (diff)
* --help: Don't show examples, refer to --manual for additional info
* Added --manual: Show entire manual page
Diffstat (limited to 'scripts/xdg-su')
-rwxr-xr-xscripts/xdg-su68
1 files changed, 63 insertions, 5 deletions
diff --git a/scripts/xdg-su b/scripts/xdg-su
index ccbf4ac..6894d07 100755
--- a/scripts/xdg-su
+++ b/scripts/xdg-su
@@ -33,15 +33,67 @@
#
#---------------------------------------------
-examples()
+manualpage()
{
-cat << _EXAMPLES
+cat << _MANUALPAGE
+Name
+
+ xdg-su -- run a program as root after prompting for the root password
+
+Synopsis
+
+ xdg-su [-u user] -c command
+
+ xdg-su { --help | --manual | --version }
+
+Description
+
+ xdg-su provides a graphical dialog that prompts the user for a password to
+ run command as user or as root if no user was specified.
+
+ xdg-su is for use inside a desktop session only.
+
+Options
+
+ -u user
+ run command as user. The default is to run as root.
+
+ --help
+ Show command synopsis.
+
+ --manual
+ Show this manualpage.
+
+ --version
+ Show the xdg-utils version information.
+
+Exit Codes
+
+ An exit code of 0 indicates success while a non-zero exit code indicates
+ failure. The following failure codes can be returned:
+
+ 1
+ Error in command line syntax.
+
+ 2
+ One of the files passed on the command line did not exist.
+
+ 3
+ A required tool could not be found.
+
+ 4
+ The action failed.
+
+See Also
+
+ su(1)
+
Examples
xdg-su -u root -c "/opt/shinythings/bin/install-GUI --install fast"
Runs the /opt/shinythings/bin/install-GUI command with root permissions.
-_EXAMPLES
+_MANUALPAGE
}
usage()
@@ -53,7 +105,7 @@ Synopsis
xdg-su [-u user] -c command
- xdg-su { --help | --version }
+ xdg-su { --help | --manual | --version }
_USAGE
}
@@ -90,6 +142,7 @@ exit_failure_syntax()
echo "Try 'xdg-su --help' for more information." >&2
else
usage
+ echo "Use 'man xdg-su' or 'xdg-su --manual' for additional info."
fi
exit 1
@@ -144,7 +197,12 @@ check_common_commands()
case $parm in
--help)
usage
- examples
+ echo "Use 'man xdg-su' or 'xdg-su --manual' for additional info."
+ exit_success
+ ;;
+
+ --manual)
+ manualpage
exit_success
;;