From 122fdc0fa5fe90a7d5f6919f2d3177fd0830c360 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 11 Mar 2008 07:01:57 +0200 Subject: [PATCH] Move command line common option utilities to lib/myopt-util.c --- ChangeLog | 22 +++++++++++++++++++ dpkg-deb/main.c | 17 ++++++--------- dpkg-split/main.c | 17 ++++++--------- dselect/main.cc | 17 ++++++--------- lib/Makefile.am | 2 +- lib/dpkg.h | 5 ----- lib/{showcright.c => myopt-util.c} | 34 +++++++++++++++++++++++------- lib/myopt.h | 12 +++++++++++ src/main.c | 17 ++++++--------- src/query.c | 17 ++++++--------- 10 files changed, 91 insertions(+), 69 deletions(-) rename lib/{showcright.c => myopt-util.c} (66%) diff --git a/ChangeLog b/ChangeLog index 77445b34..fd73dcba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2008-03-11 Ian Jackson , + Guillem Jover + + * lib/showcright.c: Rename to ... + * lib/myopt-util.c: ... this. + * lib/Makefile.am (libdpkg_a_SOURCES): Rename 'showcright.c' to + 'myopt-util.c'. + + * lib/dpkg.h (struct cmdinfo): Remove declaration. + (showcopyright): Move prototype to ... + * lib/myopt-util.c: ... here. + (helponly, versiononly): New functions. + * lib/myopt.h: Include . + (showcopyright, helponly, versiononly, usage, printversion): New + function prototypes. + * dpkg-deb/main.c (printversion, usage): Remove static keyword. + (helponly, versiononly): Remove function declarations and definitions. + * dpkg-split/main.c: Likewise. + * dselect/main.cc: Likewise. + * src/main.c: Likewise. + * src/query.c: Likewise. + 2008-03-11 Guillem Jover * lib/showcright.c (showcopyright): Move function prototype to ... diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c index fe7dc68a..527bebcb 100644 --- a/dpkg-deb/main.c +++ b/dpkg-deb/main.c @@ -42,7 +42,9 @@ const char* showformat = "${Package}\t${Version}\n"; -static void printversion(void) { +void +printversion(void) +{ if (printf(_("Debian `%s' package archive backend version %s.\n"), BACKEND, DPKG_VERSION_ARCH) < 0) werr("stdout"); if (printf(_("This is free software; see the GNU General Public License version 2 or\n" @@ -51,7 +53,9 @@ static void printversion(void) { BACKEND) < 0) werr("stdout"); } -static void usage(void) { +void +usage(void) +{ if (printf(_( "Usage: %s [