mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 03:25:31 +03:00
Add simple usage message to systemd-backlight (#16709)
This commit is contained in:
parent
677bb0555a
commit
b23728ec9f
@ -23,7 +23,8 @@
|
|||||||
|
|
||||||
<refsynopsisdiv>
|
<refsynopsisdiv>
|
||||||
<para><filename>systemd-backlight@.service</filename></para>
|
<para><filename>systemd-backlight@.service</filename></para>
|
||||||
<para><filename>/usr/lib/systemd/systemd-backlight</filename></para>
|
<para><filename>/usr/lib/systemd/systemd-backlight</filename> save [backlight|leds]:DEVICE</para>
|
||||||
|
<para><filename>/usr/lib/systemd/systemd-backlight</filename> load [backlight|leds]:DEVICE</para>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
||||||
<refsect1>
|
<refsect1>
|
||||||
|
@ -13,11 +13,36 @@
|
|||||||
#include "main-func.h"
|
#include "main-func.h"
|
||||||
#include "mkdir.h"
|
#include "mkdir.h"
|
||||||
#include "parse-util.h"
|
#include "parse-util.h"
|
||||||
|
#include "pretty-print.h"
|
||||||
|
#include "terminal-util.h"
|
||||||
#include "reboot-util.h"
|
#include "reboot-util.h"
|
||||||
#include "string-util.h"
|
#include "string-util.h"
|
||||||
#include "strv.h"
|
#include "strv.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
static int help(void) {
|
||||||
|
_cleanup_free_ char *link = NULL;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
r = terminal_urlify_man("systemd-backlight", "8", &link);
|
||||||
|
if (r < 0)
|
||||||
|
return log_oom();
|
||||||
|
|
||||||
|
printf("%s save [backlight|leds]:DEVICE\n"
|
||||||
|
"%s load [backlight|leds]:DEVICE\n"
|
||||||
|
"\n%sSave and restore backlight brightness at shutdown and boot.%s\n\n"
|
||||||
|
" save Save current brightness\n"
|
||||||
|
" load Set brightness to be the previously saved value\n"
|
||||||
|
"\nSee the %s for details.\n"
|
||||||
|
, program_invocation_short_name
|
||||||
|
, program_invocation_short_name
|
||||||
|
, ansi_highlight(), ansi_normal()
|
||||||
|
, link
|
||||||
|
);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int find_pci_or_platform_parent(sd_device *device, sd_device **ret) {
|
static int find_pci_or_platform_parent(sd_device *device, sd_device **ret) {
|
||||||
const char *subsystem, *sysname, *value;
|
const char *subsystem, *sysname, *value;
|
||||||
sd_device *parent;
|
sd_device *parent;
|
||||||
@ -334,6 +359,9 @@ static int run(int argc, char *argv[]) {
|
|||||||
|
|
||||||
log_setup_service();
|
log_setup_service();
|
||||||
|
|
||||||
|
if (strv_contains(strv_skip(argv, 1), "--help"))
|
||||||
|
return help();
|
||||||
|
|
||||||
if (argc != 3)
|
if (argc != 3)
|
||||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "This program requires two arguments.");
|
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "This program requires two arguments.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user