Parcourir la source

Add proper light.1 man page, removes help2man dependency

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Joachim Nilsson il y a 6 ans
Parent
révision
79f90eb8dc
2 fichiers modifiés avec 114 ajouts et 11 suppressions
  1. 2
    11
      Makefile
  2. 112
    0
      light.1

+ 2
- 11
Makefile Voir le fichier

@@ -4,26 +4,17 @@ MANDIR=$(PREFIX)/share/man/man1
4 4
 
5 5
 CC=gcc
6 6
 CFLAGS=-std=c89 -O2 -pedantic -Wall -I"./include" -D_XOPEN_SOURCE=500
7
-MANFLAGS=-h -h -v -V -N
8
-
9
-HELP2MAN_VERSION := $(shell help2man --version 2>/dev/null)
10 7
 
11 8
 light: src/helpers.c src/light.c src/main.c
12 9
 	$(CC) $(CFLAGS) -g -o $@ $^
13 10
 
14
-man: light
15
-ifndef HELP2MAN_VERSION
16
-$(error "help2man is not installed")
17
-endif
18
-	help2man $(MANFLAGS) ./light | gzip - > light.1.gz
19
-
20
-install: light man
11
+install: light
21 12
 	mkdir -p $(BINDIR)
22 13
 	cp -f ./light $(BINDIR)/light
23 14
 	chown root $(BINDIR)/light
24 15
 	chmod 4755 $(BINDIR)/light
25 16
 	mkdir -p $(MANDIR)
26
-	mv light.1.gz $(MANDIR)
17
+	cp -f light.1 $(MANDIR)
27 18
 
28 19
 uninstall:
29 20
 	rm $(BINDIR)/light

+ 112
- 0
light.1 Voir le fichier

@@ -0,0 +1,112 @@
1
+.\"  -*- nroff -*-
2
+.Dd August 4, 2018
3
+.Os GNU/Linux
4
+.Dt LIGHT 1 URM
5
+.Sh NAME
6
+.Nm light
7
+.Nd a program to control backlight controllers
8
+.Sh SYNOPSIS
9
+.Nm light
10
+.Op Fl abcGhHkIlLmOprV
11
+.Op Fl s Ar ARG
12
+.Op Fl v Ar LEVEL
13
+.Op Fl A Ar VAL
14
+.Op Fl S Ar VAL
15
+.Op Fl U Ar VAL
16
+.Sh DESCRIPTION
17
+.Nm
18
+is a program to control backlight display and keyboard controllers under
19
+GNU/Linux.
20
+.Pp
21
+.Bl -bullet -compact
22
+.It
23
+Operates independently of X (X-Window)
24
+.It
25
+Can automatically figure out the best controller to use, making full use
26
+of the underlying hardware
27
+.It
28
+Supports a minimum cap on the brightness value, as some controllers set
29
+the display to be pitch black at a vaĺue of 0 (or higher)
30
+.El
31
+.Sh COMMANDS
32
+The following unique commands are supported:
33
+.Pp
34
+.Bl -tag -width Ds
35
+.It Fl A Ar VAL
36
+Add value
37
+.It Fl G
38
+Get value, default
39
+.It Fl H , Fl h
40
+Show help text and exit
41
+.It Fl I
42
+Restore brightness
43
+.It Fl L
44
+List controllers
45
+.It Fl O
46
+Save brightness
47
+.It Fl S Ar VAL
48
+Set value
49
+.It Fl U Ar VAL
50
+Subtract value
51
+.It Fl V
52
+Show program version and exit
53
+.El
54
+.Sh OPTIONS
55
+The behavior of the above commands can be modified using these options:
56
+.Pp
57
+.Bl -tag -width Ds
58
+.It Fl b
59
+Set
60
+.Fl S ,
61
+Get
62
+.Fl G ,
63
+Add
64
+.Fl A ,
65
+or Subtract
66
+.Fl U
67
+active brightness, default
68
+.It Fl k
69
+Act on keyboard backlight
70
+.It Fl l
71
+Act on display backlight, default
72
+.It Fl m
73
+Get 
74
+.Fl G
75
+maximum brightness
76
+.It Fl c
77
+Set
78
+.Fl S
79
+or get
80
+.Fl G
81
+minimum cap for brightness
82
+.It Fl a
83
+Select controller automatically, default
84
+.It Fl p
85
+Interpret input and output values in percent, default
86
+.It Fl r
87
+Interpret input and output values in raw mode
88
+.It Fl s Ar ARG
89
+Specify controller to use.  Use
90
+.Fl L
91
+to list available controllers
92
+.It Fl v Ar ARG
93
+Set verbosity level, by default
94
+.Nm
95
+only outputs read values:
96
+.Pp
97
+.Bl -tag -width 0: -compact
98
+.It 0:
99
+Read values
100
+.It 1:
101
+Read values, Errors
102
+.It 2:
103
+Read values, Errors, Warnings
104
+.It 3:
105
+Read values, Errors, Warnings, Notices
106
+.El
107
+.El
108
+.Sh AUTHORS
109
+Copyright \(co 2014 Fredrik Haikarainen
110
+.Pp
111
+This is free software, see the source for copying conditions.  There is NO
112
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE