]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: add page for systemd-ac-power
authorLuca Boccassi <bluca@debian.org>
Wed, 1 Feb 2023 19:29:11 +0000 (19:29 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 1 Feb 2023 21:56:28 +0000 (21:56 +0000)
It is now a supported executable, so add manpage.

Fixes https://github.com/systemd/systemd/issues/26289

man/rules/meson.build
man/systemd-ac-power.xml [new file with mode: 0644]

index 75197736b0f0a2aba98478136879b449d6457de9..c5b457bd7f9d42ad009223b24818c04515c3b3b6 100644 (file)
@@ -856,6 +856,7 @@ manpages = [
  ['shutdown', '8', [], ''],
  ['sysctl.d', '5', [], ''],
  ['systemctl', '1', [], ''],
+ ['systemd-ac-power', '1', [], ''],
  ['systemd-analyze', '1', [], 'ENABLE_ANALYZE'],
  ['systemd-ask-password-console.service',
   '8',
diff --git a/man/systemd-ac-power.xml b/man/systemd-ac-power.xml
new file mode 100644 (file)
index 0000000..a4c9378
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version='1.0'?> <!--*-nxml-*-->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
+
+<refentry id="systemd-ac-power" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+  <refentryinfo>
+    <title>systemd-ac-power</title>
+    <productname>systemd</productname>
+  </refentryinfo>
+
+  <refmeta>
+    <refentrytitle>systemd-ac-power</refentrytitle>
+    <manvolnum>1</manvolnum>
+  </refmeta>
+
+  <refnamediv>
+    <refname>systemd-ac-power</refname>
+    <refpurpose>Report whether we are connected to an external power source</refpurpose>
+  </refnamediv>
+
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>systemd-ac-power</command>
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>Description</title>
+
+    <para><command>systemd-ac-power</command> may be used to check whether the system
+    is running on AC power or not. By default it will simply return success (if we
+    can detect that we are running on AC power) or failure, with no output.
+    This can be useful for example to debug <varname>ConditionACPower=</varname> (see
+    <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>).</para>
+  </refsect1>
+
+  <refsect1>
+    <title>Options</title>
+
+    <para>The following options are understood:</para>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>-v</option></term>
+        <term><option>--verbose</option></term>
+
+        <listitem><para>Show result as text instead of just returning success or failure.</para></listitem>
+      </varlistentry>
+
+      <xi:include href="standard-options.xml" xpointer="help" />
+      <xi:include href="standard-options.xml" xpointer="version" />
+    </variablelist>
+  </refsect1>
+
+  <refsect1>
+    <title>Exit status</title>
+
+    <para>On success (running on AC power), 0 is returned, a non-zero failure code otherwise.</para>
+  </refsect1>
+
+  <refsect1>
+    <title>See Also</title>
+    <para>
+      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+    </para>
+  </refsect1>
+
+</refentry>