Document the --autocopy flag (#15)

* Sort arguments alphabetically

* Document the --autocopy flag
This commit is contained in:
Thomas Voss 2022-11-20 11:37:39 +01:00 committed by GitHub
parent 3255d91668
commit f6c24d90e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View File

@ -6,7 +6,7 @@
.Nd wlroots-compatible wayland color picker .Nd wlroots-compatible wayland color picker
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm .Nm
.Op Fl nh .Op Fl anh
.Op Fl f Ar fmt .Op Fl f Ar fmt
.Sh DESCRIPTION .Sh DESCRIPTION
The The
@ -22,7 +22,14 @@ option.
.Pp .Pp
The options are as follows: The options are as follows:
.Bl -tag -width Ds .Bl -tag -width Ds
.It Fl f Ns , Fl \-format Ns = Ns Ar fmt .It Fl a , Fl Fl autocopy
Automatically copy the output of
.Nm
to the clipboard.
This option requires that the
.Xr wl-copy 1
command is installed on system.
.It Fl f Ar fmt , Fl Fl format Ns = Ns Ar fmt
Select the format to output the selected pixels color in. Select the format to output the selected pixels color in.
The argument The argument
.Ar fmt .Ar fmt
@ -44,10 +51,10 @@ The available options are:
.Pp .Pp
The default format is The default format is
.Ar hex . .Ar hex .
.It Fl n Ns , Fl \-no\-fancy .It Fl n , Fl Fl no-fancy
Disable colored output. Disable colored output.
Default behavior is to color the output in the same color as the selected pixel. Default behavior is to color the output in the same color as the selected pixel.
.It Fl h Ns , Fl \-help .It Fl h , Fl Fl help
Display a help message and exit successfully from the program. Display a help message and exit successfully from the program.
.El .El
.Sh ENVIRONMENT .Sh ENVIRONMENT
@ -70,7 +77,8 @@ function:
.Sh SEE ALSO .Sh SEE ALSO
.Xr hyprctl 1 , .Xr hyprctl 1 ,
.Xr hyprland 1 , .Xr hyprland 1 ,
.Xr sed 1 .Xr sed 1 ,
.Xr wl-copy 1
.Pp .Pp
.Lk https://github.com/hyprwm/hyprpicker "The Hyprpicker Sources" .Lk https://github.com/hyprwm/hyprpicker "The Hyprpicker Sources"
.Sh AUTHORS .Sh AUTHORS

View File

@ -4,9 +4,9 @@
static void help(void) { static void help(void) {
std::cout << "Hyprpicker usage: hyprpicker [arg [...]].\n\nArguments:\n" << std::cout << "Hyprpicker usage: hyprpicker [arg [...]].\n\nArguments:\n" <<
" -a | --autocopy | Automatically copies the output to the clipboard (requires wl-clipboard)\n" <<
" -f | --format=fmt | Specifies the output format (cmyk, hex, rgb, hsl, hsv)\n" << " -f | --format=fmt | Specifies the output format (cmyk, hex, rgb, hsl, hsv)\n" <<
" -n | --no-fancy | Disables the \"fancy\" (aka. colored) outputting\n" << " -n | --no-fancy | Disables the \"fancy\" (aka. colored) outputting\n" <<
" -a | --autocopy | Automatically copies the output to the clipboard (requires wl-clipboard)\n" <<
" -h | --help | Show this help message\n"; " -h | --help | Show this help message\n";
} }
@ -16,10 +16,10 @@ int main(int argc, char** argv, char** envp) {
while (true) { while (true) {
int option_index = 0; int option_index = 0;
static struct option long_options[] = { static struct option long_options[] = {
{"autocopy", no_argument, NULL, 'a'},
{"format", required_argument, NULL, 'f'}, {"format", required_argument, NULL, 'f'},
{"help", no_argument, NULL, 'h'}, {"help", no_argument, NULL, 'h'},
{"no-fancy", no_argument, NULL, 'n'}, {"no-fancy", no_argument, NULL, 'n'},
{"autocopy", no_argument, NULL, 'a'},
{NULL, 0, NULL, 0 } {NULL, 0, NULL, 0 }
}; };