wmmisc: Add support for wmgeneral's -display command line argument

This commit is contained in:
Doug Torrance 2018-07-11 22:12:50 -04:00 committed by Carlos R. Mafra
parent 21c9a972a6
commit 01bb8bdecf
2 changed files with 13 additions and 5 deletions

View file

@ -18,6 +18,7 @@
* *
*/ */
#include <getopt.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
@ -42,7 +43,8 @@ dockapp_show_help( const char* wm_name )
printf( "Number of users logged in, total processes, total number of processes running,\n" ); printf( "Number of users logged in, total processes, total number of processes running,\n" );
printf( "the system's fork count and load average.\n\n" ); printf( "the system's fork count and load average.\n\n" );
printf( " -h display this help and exit\n" ); printf( " -h display this help and exit\n" );
printf( " -v output version information and exit\n\n" ); printf( " -v output version information and exit\n" );
printf( " -display DISPLAY set display\n\n");
printf( "Report bugs to <" PACKAGE_BUGREPORT ">.\n" ); printf( "Report bugs to <" PACKAGE_BUGREPORT ">.\n" );
} }
@ -97,6 +99,10 @@ int
main( int argc, char** argv ) main( int argc, char** argv )
{ {
int opt = 0; int opt = 0;
const struct option longopts[] = {
{"display", required_argument, NULL, 0},
{0, 0, 0, 0}
};
#ifdef USE_MTRACE #ifdef USE_MTRACE
mtrace(); mtrace();
@ -105,7 +111,7 @@ main( int argc, char** argv )
signal( SIGINT, dockapp_exit ); signal( SIGINT, dockapp_exit );
signal( SIGSEGV, dockapp_crash ); signal( SIGSEGV, dockapp_crash );
opt = getopt( argc, argv, "hv" ); opt = getopt_long_only( argc, argv, "hv", longopts, NULL);
while ( -1 != opt ) while ( -1 != opt )
{ {
@ -126,7 +132,7 @@ main( int argc, char** argv )
} }
} }
opt = getopt( argc, argv, "hv" ); opt = getopt_long_only( argc, argv, "hv", longopts, NULL);
} }
createXBMfromXPM( wmmisc_mask_bits, createXBMfromXPM( wmmisc_mask_bits,

View file

@ -37,7 +37,9 @@ Output version information and exit
.TP .TP
.B \-h .B \-h
Display help and exit Display help and exit
.TP
.B \-display DISPLAY
Set display
.SH BUGS .SH BUGS
Report bugs and suggestion to the current \fBwmmisc\fR maintainer: Report bugs and suggestion to the current \fBwmmisc\fR maintainer:
Jesse S. <luxorfalls@sbcglobal.net>. Jesse S. <luxorfalls@sbcglobal.net>.