1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-06 22:04:12 +01:00

Latest fixes for released 0.51.0

This commit is contained in:
dan
1999-01-29 08:11:17 +00:00
parent d694d6fe1c
commit 931a37b124
56 changed files with 2916 additions and 2383 deletions

View File

@@ -9,11 +9,10 @@ bin_SCRIPTS = wmaker.inst wm-oldmenu2new wsetfont
EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wsetfont directjpeg.c
INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib \
-I$(top_srcdir)/libPropList @XCFLAGS@ @GFXFLAGS@
INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib @XCFLAGS@ @GFXFLAGS@
# X_EXTRA_LIBS is for libproplist in systems that need -lsocket
liblist= $(top_builddir)/libPropList/libPropList.la @X_EXTRA_LIBS@
liblist= @XLFLAGS@ @LIBPL@ @X_EXTRA_LIBS@
wdwrite_LDADD = $(liblist)
@@ -33,7 +32,7 @@ geticonset_LDADD= $(liblist)
wmsetbg_LDADD = \
$(top_builddir)/WINGs/libWINGs.a \
$(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/libPropList/libPropList.la \
@LIBPL@ \
@GFXLFLAGS@ @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
getstyle_SOURCES = getstyle.c

View File

@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.3 from Makefile.am
# Makefile.in generated automatically by automake 1.4 from Makefile.am
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,7 @@
# PARTICULAR PURPOSE.
SHELL = /bin/sh
SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
@@ -32,7 +32,7 @@ mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
DISTDIR =
DESTDIR =
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
@@ -44,7 +44,7 @@ AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
@@ -66,6 +66,7 @@ GFXLIBS = @GFXLIBS@
ICONEXT = @ICONEXT@
INTLIBS = @INTLIBS@
LD = @LD@
LIBPL = @LIBPL@
LIBTOOL = @LIBTOOL@
LITE = @LITE@
LN_S = @LN_S@
@@ -86,7 +87,7 @@ wprefsdir = @wprefsdir@
AUTOMAKE_OPTIONS = no-dependencies
pkgdatadir = $(datadir)/@PACKAGE@
pkgdatadir = $(datadir)/@PACKAGE@
bin_PROGRAMS = wxcopy wxpaste wdwrite getstyle setstyle seticons geticonset wmsetbg
@@ -94,11 +95,10 @@ bin_SCRIPTS = wmaker.inst wm-oldmenu2new wsetfont
EXTRA_DIST = wmaker.inst.in bughint wm-oldmenu2new wsetfont directjpeg.c
INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib \
-I$(top_srcdir)/libPropList @XCFLAGS@ @GFXFLAGS@
INCLUDES = @DFLAGS@ -I$(top_srcdir)/wrlib @XCFLAGS@ @GFXFLAGS@
# X_EXTRA_LIBS is for libproplist in systems that need -lsocket
liblist= $(top_builddir)/libPropList/libPropList.la @X_EXTRA_LIBS@
liblist = @XLFLAGS@ @LIBPL@ @X_EXTRA_LIBS@
wdwrite_LDADD = $(liblist)
@@ -110,15 +110,12 @@ getstyle_LDADD = $(liblist)
setstyle_LDADD = $(liblist)
seticons_LDADD= $(liblist)
seticons_LDADD = $(liblist)
geticonset_LDADD= $(liblist)
geticonset_LDADD = $(liblist)
wmsetbg_LDADD = $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBPL@ @GFXLFLAGS@ @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
wmsetbg_LDADD = \
$(top_builddir)/WINGs/libWINGs.a \
$(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/libPropList/libPropList.la \
@GFXLFLAGS@ @XLFLAGS@ @GFXLIBS@ @XLIBS@ -lm
getstyle_SOURCES = getstyle.c
@@ -157,46 +154,45 @@ wxpaste_OBJECTS = wxpaste.o
wxpaste_DEPENDENCIES =
wxpaste_LDFLAGS =
wdwrite_OBJECTS = wdwrite.o
wdwrite_DEPENDENCIES = $(top_builddir)/libPropList/libPropList.la
wdwrite_DEPENDENCIES =
wdwrite_LDFLAGS =
getstyle_OBJECTS = getstyle.o
getstyle_DEPENDENCIES = $(top_builddir)/libPropList/libPropList.la
getstyle_DEPENDENCIES =
getstyle_LDFLAGS =
setstyle_OBJECTS = setstyle.o
setstyle_DEPENDENCIES = $(top_builddir)/libPropList/libPropList.la
setstyle_DEPENDENCIES =
setstyle_LDFLAGS =
seticons_OBJECTS = seticons.o
seticons_DEPENDENCIES = $(top_builddir)/libPropList/libPropList.la
seticons_DEPENDENCIES =
seticons_LDFLAGS =
geticonset_OBJECTS = geticonset.o
geticonset_DEPENDENCIES = $(top_builddir)/libPropList/libPropList.la
geticonset_DEPENDENCIES =
geticonset_LDFLAGS =
wmsetbg_OBJECTS = wmsetbg.o
wmsetbg_DEPENDENCIES = $(top_builddir)/WINGs/libWINGs.a \
$(top_builddir)/wrlib/libwraster.la \
$(top_builddir)/libPropList/libPropList.la
$(top_builddir)/wrlib/libwraster.la
wmsetbg_LDFLAGS =
SCRIPTS = $(bin_SCRIPTS)
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README Makefile.am Makefile.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
GZIP_ENV = --best
SOURCES = $(wxcopy_SOURCES) $(wxpaste_SOURCES) $(wdwrite_SOURCES) $(getstyle_SOURCES) $(setstyle_SOURCES) $(seticons_SOURCES) $(geticonset_SOURCES) $(wmsetbg_SOURCES)
OBJECTS = $(wxcopy_OBJECTS) $(wxpaste_OBJECTS) $(wdwrite_OBJECTS) $(getstyle_OBJECTS) $(setstyle_OBJECTS) $(seticons_OBJECTS) $(geticonset_OBJECTS) $(wmsetbg_OBJECTS)
all: Makefile $(PROGRAMS) $(SCRIPTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .lo .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@@ -218,15 +214,15 @@ install-binPROGRAMS: $(bin_PROGRAMS)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
done
.c.o:
@@ -321,8 +317,12 @@ uninstall-binSCRIPTS:
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP)
list='$(SOURCES) $(HEADERS)'; \
unique=`for i in $$list; do echo $$i; done | \
awk ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
here=`pwd` && cd $(srcdir) \
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
&& mkid -f$$here/ID $$unique $(LISP)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
@@ -350,72 +350,87 @@ subdir = util
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
d=$(srcdir); \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
if test -d $$d/$$file; then \
cp -pr $$/$$file $(distdir)/$$file; \
else \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file || :; \
fi; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-exec: install-binPROGRAMS install-binSCRIPTS
@$(NORMAL_INSTALL)
info-am:
info: info-am
dvi-am:
dvi: dvi-am
check-am: all-am
check: check-am
installcheck-am:
installcheck: installcheck-am
install-exec-am: install-binPROGRAMS install-binSCRIPTS
install-exec: install-exec-am
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-binPROGRAMS uninstall-binSCRIPTS
install-data-am:
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS
uninstall: uninstall-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS)
all-redirect: all-am
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
$(mkinstalldirs) $(DATADIR)$(bindir) $(DATADIR)$(bindir)
$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
mostlyclean-generic:
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f Makefile $(DISTCLEANFILES)
-rm -f Makefile $(CONFIG_CLEAN_FILES)
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-libtool mostlyclean-tags \
mostlyclean-generic
clean: clean-binPROGRAMS clean-compile clean-libtool clean-tags \
clean-generic mostlyclean
mostlyclean: mostlyclean-am
distclean: distclean-binPROGRAMS distclean-compile distclean-libtool \
distclean-tags distclean-generic clean
-rm -f config.status
clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \
clean-generic mostlyclean-am
clean: clean-am
distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \
distclean-tags distclean-generic clean-am
-rm -f libtool
maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
maintainer-clean-libtool maintainer-clean-tags \
maintainer-clean-generic distclean
distclean: distclean-am
maintainer-clean-am: maintainer-clean-binPROGRAMS \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-tags maintainer-clean-generic \
distclean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
maintainer-clean: maintainer-clean-am
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
clean-libtool maintainer-clean-libtool uninstall-binSCRIPTS \
install-binSCRIPTS tags mostlyclean-tags distclean-tags clean-tags \
maintainer-clean-tags distdir info dvi installcheck install-exec \
install-data install uninstall all installdirs mostlyclean-generic \
maintainer-clean-tags distdir info-am info dvi-am dvi check check-am \
installcheck-am installcheck install-exec-am install-exec \
install-data-am install-data install-am install uninstall-am uninstall \
all-redirect all-am all installdirs mostlyclean-generic \
distclean-generic clean-generic maintainer-clean-generic clean \
mostlyclean distclean maintainer-clean

View File

@@ -1,8 +1,8 @@
/* geticonset.c - outputs icon configuration from WindowMaker to stdout
*
* WindowMaker window manager
* Window Maker window manager
*
* Copyright (c) 1997, 1998 Alfredo K. Kojima
* Copyright (c) 1997, 1998, 1999 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,8 @@
* USA.
*/
#define PROG_VERSION "geticonset (Window Maker) 0.1"
#include <stdlib.h>
#include <stdio.h>
@@ -30,7 +32,6 @@
char *ProgName;
@@ -65,6 +66,16 @@ defaultsPathForDomain(char *domain)
return tmp;
}
void
print_help()
{
printf("Usage: %s [OPTIONS] [FILE]\n", ProgName);
puts("Retrieves program icon configuration and output to FILE or to stdout");
puts("");
puts(" --help display this help and exit");
puts(" --version output version information and exit");
}
int
main(int argc, char **argv)
@@ -75,12 +86,18 @@ main(int argc, char **argv)
char *path;
int i;
ProgName = argv[0];
if (argc>2 || (argc==2 && strcmp(argv[1], "-h")==0)) {
printf("Syntax:\n%s [<iconset file>]\n", argv[0]);
exit(1);
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-h")==0
|| strcmp(argv[i], "--help")==0) {
print_help();
exit(0);
} else if (strcmp(argv[i], "--version")==0) {
puts(PROG_VERSION);
exit(0);
}
}
path = defaultsPathForDomain("WMWindowAttributes");

View File

@@ -21,6 +21,10 @@
*/
#define PROG_VERSION "getstyle (Window Maker) 0.2"
#include <stdlib.h>
#include <stdio.h>
#include <proplist.h>
@@ -84,7 +88,7 @@ static char *theme_options[] = {
char *ProgName;
char *PixmapPath = NULL;
proplist_t PixmapPath = NULL;
char *ThemePath = NULL;
@@ -92,11 +96,13 @@ char *ThemePath = NULL;
void
print_help()
{
printf("usage: %s [-options] [<style file>]\n", ProgName);
puts("options:");
puts(" -h print help");
puts(" -t get theme options too");
puts(" -p produce a theme pack");
printf("Usage: %s [OPTIONS] [FILE]\n", ProgName);
puts("Retrieves style/theme configuration and output to FILE or to stdout");
puts("");
puts(" -t, --theme-options output theme related options when producing a style file");
puts(" -p, --pack produce output as a theme pack");
puts(" --help display this help and exit");
puts(" --version output version information and exit");
}
@@ -514,16 +520,21 @@ main(int argc, char **argv)
if (argc>1) {
for (i=1; i<argc; i++) {
if (strcmp(argv[i], "-p")==0) {
if (strcmp(argv[i], "-p")==0
|| strcmp(argv[i], "--pack")==0) {
make_pack = 1;
theme_too = 1;
} else if (strcmp(argv[i], "-t")==0) {
} else if (strcmp(argv[i], "-t")==0
|| strcmp(argv[i], "--theme-options")==0) {
theme_too++;
} else if (argv[i][0] != '-') {
} else if (strcmp(argv[i], "--help")==0) {
print_help();
exit(0);
} else if (strcmp(argv[i], "--version")==0) {
puts(PROG_VERSION);
exit(0);
} else {
style_file = argv[i];
} else {
print_help();
exit(1);
}
}
}
@@ -567,7 +578,7 @@ main(int argc, char **argv)
val = PLGetDictionaryEntry(prop, PLMakeString("PixmapPath"));
if (val)
PixmapPath = PLGetString(val);
PixmapPath = val;
if (theme_too) {
for (i=0; theme_options[i]!=NULL; i++) {

View File

@@ -20,6 +20,8 @@
* USA.
*/
#define PROG_VERSION "seticons (Window Maker) 0.1"
#include <stdlib.h>
#include <stdio.h>
@@ -64,6 +66,17 @@ defaultsPathForDomain(char *domain)
}
void
print_help()
{
printf("Usage: %s [OPTIONS] FILE\n", ProgName);
puts("Reads icon configuration from FILE and updates Window Maker.");
puts("");
puts(" --help display this help and exit");
puts(" --version output version information and exit");
}
int
main(int argc, char **argv)
{
@@ -71,13 +84,32 @@ main(int argc, char **argv)
proplist_t all_windows, iconset;
proplist_t keylist;
int i;
char *path;
char *path = NULL;
ProgName = argv[0];
if (argc!=2) {
printf("Syntax:\n%s <iconset file>\n", argv[0]);
exit(1);
if (argc < 2) {
printf("%s: missing argument\n", ProgName);
printf("Try '%s --help' for more information\n", ProgName);
}
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-h")==0
|| strcmp(argv[i], "--help")==0) {
print_help();
exit(0);
} else if (strcmp(argv[i], "--version")==0) {
puts(PROG_VERSION);
exit(0);
} else {
if (path) {
printf("%s: invalid argument '%s'\n", ProgName, argv[i]);
printf("Try '%s --help' for more information\n", ProgName);
exit(1);
}
path = argv[i];
}
}
path = defaultsPathForDomain("WMWindowAttributes");

View File

@@ -21,6 +21,8 @@
*/
#define PROG_VERSION "setstyle (Window Maker) 0.2"
#include <stdlib.h>
#include <stdio.h>
#include <proplist.h>
@@ -246,32 +248,57 @@ StringCompareHook(proplist_t pl1, proplist_t pl2)
void
print_help()
{
printf("Usage: %s [OPTIONS] FILE\n", ProgName);
puts("Reads style/theme configuration from FILE and updates Window Maker.");
puts("");
puts(" --no-fonts ignore font related options");
puts(" --help display this help and exit");
puts(" --version output version information and exit");
}
int
main(int argc, char **argv)
{
proplist_t prop, style;
char *path;
char *file = NULL;
struct stat statbuf;
int i;
ProgName = argv[0];
if (argc<2) {
printf("Syntax:\n%s [-nofonts] <style file>\n", argv[0]);
printf("%s: missing argument\n", ProgName);
printf("Try '%s --help' for more information\n", ProgName);
exit(1);
}
if (argc == 3) {
if (strcmp(argv[1], "-nofonts")==0) {
for (i = 1; i < argc; i++) {
if (strcmp("--no-fonts", argv[i])==0) {
ignoreFonts = 1;
} else if (strcmp("--version", argv[i])==0) {
puts(PROG_VERSION);
exit(0);
} else if (strcmp("--help", argv[i])==0) {
print_help();
exit(0);
} else {
printf("Syntax:\n%s <style file> [-nofonts]\n", argv[0]);
exit(1);
if (file) {
printf("%s: invalid argument '%s'\n", ProgName, argv[i]);
printf("Try '%s --help' for more information\n", ProgName);
exit(1);
}
file = argv[i];
}
}
PLSetStringCmpHook(StringCompareHook);
path = defaultsPathForDomain("WindowMaker");
prop = PLGetProplistWithPath(path);
@@ -281,8 +308,8 @@ main(int argc, char **argv)
exit(1);
}
if (stat(argv[argc-1], &statbuf) < 0) {
perror(argv[argc-1]);
if (stat(file, &statbuf) < 0) {
perror(file);
exit(1);
}
@@ -293,19 +320,19 @@ main(int argc, char **argv)
if (*argv[argc-1] != '/') {
if (!getcwd(buffer, 4000)) {
printf("%s: complete path for %s is too long\n", ProgName,
argv[argc-1]);
file);
exit(1);
}
if (strlen(buffer) + strlen(argv[argc-1]) > 4000) {
if (strlen(buffer) + strlen(file) > 4000) {
printf("%s: complete path for %s is too long\n", ProgName,
argv[argc-1]);
file);
exit(1);
}
strcat(buffer, "/");
} else {
buffer[0] = 0;
}
strcat(buffer, argv[argc-1]);
strcat(buffer, file);
prefix = malloc(strlen(buffer)+10);
if (!prefix) {
@@ -326,10 +353,9 @@ main(int argc, char **argv)
hackPaths(style, prefix);
free(prefix);
} else {
style = PLGetProplistWithPath(argv[argc-1]);
style = PLGetProplistWithPath(file);
if (!style) {
printf("%s:could not load style file \"%s\".\n", ProgName,
argv[argc-1]);
printf("%s:could not load style file \"%s\".\n", ProgName, file);
exit(1);
}
}

View File

@@ -20,6 +20,8 @@
* USA.
*/
#define PROG_VERSION "wdwrite (Window Maker) 0.2"
/*
* WindowMaker defaults DB writer
@@ -69,7 +71,10 @@ void wAbort()
void help()
{
printf("Syntax:\n%s <domain> <option> <value>\n", ProgName);
printf("Syntax:\n%s [OPTIONS] <domain> <option> <value>\n", ProgName);
puts("");
puts(" --help display this help message");
puts(" --version output version information and exit");
exit(1);
}
@@ -79,11 +84,24 @@ int main(int argc, char **argv)
char path[256];
proplist_t dom, key, value, dict;
char *gsdir;
int i;
ProgName = argv[0];
for (i = 1; i < argc; i++) {
if (strcmp("--help", argv[i])==0) {
help();
exit(0);
} else if (strcmp("--version", argv[i])==0) {
puts(PROG_VERSION);
exit(0);
}
}
if (argc<4) {
help();
printf("%s: invalid argument format\n", ProgName);
printf("Try '%s --help' for more information\n", ProgName);
exit(1);
}
dom = PLMakeString(argv[1]);

View File

@@ -972,8 +972,9 @@ wAbort()
void
print_help(char *ProgName)
{
printf("usage: %s [options] image\n", ProgName);
puts("options:");
printf("Usage: %s [options] [image]\n", ProgName);
puts("Sets the workspace background to the specified image or a texture and optionally update Window Maker configuration");
puts("");
#define P(m) puts(m)
P(" -display display to use");
P(" -d, --dither dither image");
@@ -1154,15 +1155,21 @@ main(int argc, char **argv)
printf(PROG_VERSION);
exit(0);
} else if (strcmp(argv[i], "--help")==0) {
print_help(argv[0]);
exit(0);
} else if (argv[i][0] != '-') {
image_name = argv[i];
} else {
print_help(argv[0]);
printf("%s: invalid argument '%s'\n", argv[0], argv[i]);
printf("Try '%s --help' for more information\n", argv[0]);
exit(1);
}
}
if (!image_name && !texture) {
printf("%s: you must specify a image file name\n", argv[0]);
printf("%s: you must specify a image file name or a texture\n",
argv[0]);
printf("Try '%s --help' for more information\n", argv[0]);
exit(1);
}

View File

@@ -1,6 +1,6 @@
/* wxcopy.c- copy stdin or file into cutbuffer
*
* Copyright (c) 1997 Alfredo K. Kojima
* Copyright (c) 1997-1999 Alfredo K. Kojima
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,6 +17,9 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define PROG_VERSION "wxcopy 0.3"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -32,16 +35,15 @@
void
help(char *progn)
{
fprintf
(
stderr,
"usage: %s [options] [filename]\n"
" -display display\n"
" -cutbuffer number\n"
" -nolimit\n"
" -clearselection\n",
progn
);
printf("Usage: %s [OPTIONS] [FILE]\n", progn);
puts("Copies data from FILE or stdin into X cut buffer.");
puts("");
puts(" -display <display> display to use");
puts(" --cutbuffer <number> cutbuffer number to put data");
puts(" --no-limit do not limit size of input data");
puts(" --clear-selection clears the current PRIMARY selection");
puts(" --help display this help and exit");
puts(" --version output version information and exit");
}
static int
@@ -51,6 +53,7 @@ errorHandler(Display *dpy, XErrorEvent *err)
return 0;
}
int
main(int argc, char **argv)
{
@@ -68,14 +71,18 @@ main(int argc, char **argv)
for (i=1; i<argc; i++) {
if (argv[i][0]=='-') {
if (argv[i][1]=='h') {
if (strcmp(argv[i], "--help")==0) {
help(argv[0]);
exit(0);
} else if (strcmp(argv[i],"-cutbuffer")==0) {
} else if (strcmp(argv[i], "--version")==0) {
puts(PROG_VERSION);
exit(0);
} else if (strcmp(argv[i],"-cutbuffer")==0
|| strcmp(argv[i],"--cutbuffer")==0) {
if (i<argc-1) {
i++;
if (sscanf(argv[i],"%i", &buffer)!=1) {
fprintf(stderr, "%s: could not convert \"%s\" to int\n",
fprintf(stderr, "%s: could not convert '%s' to int\n",
argv[0], argv[i]);
exit(1);
}
@@ -85,22 +92,27 @@ main(int argc, char **argv)
exit(1);
}
} else {
help(argv[0]);
printf("%s: missing argument for '%s'\n", argv[0], argv[i]);
printf("Try '%s --help' for more information\n", argv[0]);
exit(1);
}
} else if (strcmp(argv[i], "-display")==0) {
if (i < argc-1) {
display_name = argv[++i];
} else {
help(argv[0]);
printf("%s: missing argument for '%s'\n", argv[0], argv[i]);
printf("Try '%s --help' for more information\n", argv[0]);
exit(1);
}
} else if (strcmp(argv[i],"-clearselection")==0) {
} else if (strcmp(argv[i],"-clearselection")==0
|| strcmp(argv[i],"--clear-selection")==0) {
clear_selection = 1;
} else if (strcmp(argv[i],"-nolimit")==0) {
} else if (strcmp(argv[i],"-nolimit")==0
|| strcmp(argv[i],"--no-limit")==0) {
limit_check = 0;
} else {
help(argv[0]);
printf("%s: invalid argument '%s'\n", argv[0], argv[i]);
printf("Try '%s --help' for more information\n", argv[0]);
exit(1);
}
} else {

View File

@@ -17,6 +17,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#define PROG_VERSION "wxpaste (Window Maker) 0.3"
#include "../src/config.h"
#include <stdio.h>
@@ -39,12 +41,15 @@
void
help(char *progn)
{
fprintf(stderr,
"usage: %s [options]\n"
" -display display-name\n"
" -cutbuffer number\n"
" -selection [selection-name]\n"
, progn);
printf("Usage: %s [OPTIONS] [FILE]\n", progn);
puts("Copies data from X selection or cutbuffer to FILE or stdout.");
puts("");
puts(" -display display display to use");
puts(" --cutbuffer number cutbuffer number to get data from");
puts(" --selection [selection] reads data from named selection instead of\n"
" cutbuffer");
puts(" --help display this help and exit");
puts(" --version output version information and exit");
}
@@ -165,10 +170,14 @@ main(int argc, char **argv)
for (i=1; i<argc; i++) {
if (argv[i][0]=='-') {
if (argv[i][1]=='h') {
if (argv[i][1]=='h' || strcmp(argv[i], "--help")==0) {
help(argv[0]);
exit(0);
} else if (strcmp(argv[i],"-selection")==0) {
} else if (strcmp(argv[i], "--version")==0) {
puts(PROG_VERSION);
exit(0);
} else if (strcmp(argv[i],"-selection")==0
|| strcmp(argv[i],"--selection")==0) {
if (i<argc-1) {
selection_name = argv[++i];
} else {
@@ -181,7 +190,8 @@ main(int argc, char **argv)
help(argv[0]);
exit(0);
}
} else if (strcmp(argv[i],"-cutbuffer")==0) {
} else if (strcmp(argv[i],"-cutbuffer")==0
|| strcmp(argv[i],"--cutbuffer")==0) {
if (i<argc-1) {
i++;
if (sscanf(argv[i],"%i", &buffer)!=1) {
@@ -191,16 +201,21 @@ main(int argc, char **argv)
}
if (buffer<0 || buffer > 7) {
fprintf(stderr, "%s: invalid buffer number %i\n",
argv[0], buffer);
argv[0], buffer);
exit(1);
}
} else {
help(argv[0]);
fprintf(stderr, "%s: invalid argument '%s'\n", argv[0],
argv[i]);
fprintf(stderr, "Try '%s --help' for more information.\n",
argv[0]);
exit(1);
}
}
} else {
help(argv[0]);
fprintf(stderr, "%s: invalid argument '%s'\n", argv[0], argv[i]);
fprintf(stderr, "Try '%s --help' for more information.\n",
argv[0]);
exit(1);
}
}