diff options
author | Jim Meyering <meyering@redhat.com> | 2008-05-27 22:37:08 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-05-28 00:03:40 +0200 |
commit | f96625f99593a5d6477915cccc2f1e5268541563 (patch) | |
tree | f53e32813eb11b07704e6c4a5b6c6d237ede0d8a /src/lid.c | |
parent | 3719e8d5de121e950a285825bb702564c2853ff1 (diff) | |
download | idutils-f96625f99593a5d6477915cccc2f1e5268541563.tar.gz idutils-f96625f99593a5d6477915cccc2f1e5268541563.tar.bz2 idutils-f96625f99593a5d6477915cccc2f1e5268541563.zip |
build aid, eid, and gid as binaries (were scripts)
* src/lid.c: Include "lid.h".
(main): Set defaults based on new global, lid_mode.
* src/Makefile.am (bin_PROGRAMS): Add aid, eid, gid.
(dist_bin_SCRIPTS): Remove them from this list.
(noinst_HEADERS, aid_SOURCES, eid_SOURCES): Define.
(gid_SOURCES, lid_SOURCES): Define.
* src/aid, src/eid, src/gid: Remove scripts.
* src/lid-aid.c, src/lid-eid.c, src/lid-gid.c, src/lid-lid.c:
* src/lid.h: New files.
* man/Makefile.am (aid.1, eid.1, gid.1): Adjust dependencies.
* .gitignore: Add src/aid, src/eid, src/gid.
Diffstat (limited to 'src/lid.c')
-rw-r--r-- | src/lid.c | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -42,6 +42,7 @@ #include "xnls.h" #include "idfile.h" #include "iduglobal.h" +#include "lid.h" typedef void (*report_func_t) (char const *name, struct file_link **flinkv); typedef int (*query_func_t) (char const *arg, report_func_t); @@ -307,6 +308,29 @@ main (int argc, char **argv) atexit (close_stdout); + switch (lid_mode) + { + case LID_MODE_AID: /* -ils */ + ignore_case_flag = REG_ICASE; + pattern_style = ps_literal; + delimiter_style = ds_substring; + break; + + case LID_MODE_EID: /* -R edit */ + result_style = rs_edit; + break; + + case LID_MODE_GID: /* -R grep */ + result_style = rs_grep; + break; + + case LID_MODE_LID: + break; + + default: + abort (); + } + for (;;) { int optc = getopt_long (argc, argv, "f:F:a:k:R:S:ilrwsxdo", |