summaryrefslogtreecommitdiff
path: root/cliutils.h
blob: ea4539899df9622ab9cc21aabcc0475552f7f0b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef _CLIUTIL_H
#define _CLIUTIL_H

#include <stdio.h>
#include <popt.h>
#include <rpm/rpmutil.h>

RPM_GNUC_NORETURN
void argerror(const char * desc);

void printUsage(poptContext con, FILE * fp, int flags);

/* Initialize cli-environment, returning parsed popt context caller */
poptContext initCli(const char *ctx, struct poptOption *optionsTable,
		    int argc, char *argv[]);

/* Free up common resources, return "normalized" exit code */
int finishCli(poptContext optCon, int rc);

int initPipe(void);

void finishPipe(void);

#endif /* _CLIUTIL_H */