prout

smaller "lp" command
git clone git://git.2f30.org/prout
Log | Files | Refs | README | LICENSE

commit 8734ff2cb368a42ace20439100a8d27160b6af00
parent 995478f713d5b171b172ba1cbccbe1aa8997d804
Author: Willy Goiffon <w.goiffon@gmail.com>
Date:   Mon, 21 Oct 2013 23:26:12 +0200

Merge branch 'master' of z3bra.org:prout

Conflicts:
	src/prout.c

Diffstat:
Msrc/prout.c | 15+++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/prout.c b/src/prout.c @@ -147,18 +147,25 @@ static void check_job (cups_dest_t *dest, int job_id) int main(int argc, char **argv) { + int i = 0; int job_id = -1; - - cups_dest_t *dest; + int num_options = 0; char *file; - /* check the input file */ - if (argc < 2 || !strcmp(argv[1], "-h")) { + /* check the given arguments */ + if (argc < 2) { usage(); exit (1); } + for (i=0; (i+1 < argc) && (argv[i][0] == '-'); i++) { + switch (argv[i][1]) { + case 'h': usage(); exit(0); + default: usage(); exit(1); + } + } + /* check if the file is correct */ file = check_file(argv[1]);