## VERIFYING
* paste of selection doesnt occur till next event
+* simultaneously write and read in tide sub commands
## STAGING
+* initialize pick query from argument
* group by hostname or group env var in registrar
-* add debug Trace to fetch command
* daemonize registrar and tide executables
-* simultaneously write and read in tide sub commands
* Ctrl+D should not pass tag name as arg when executing tag commands
* 'Get' tag with argument currently segfaults
* registrar doesnt match open windows when new file created and is then opened for edit or line number
) { \
int brk_; char argc_ , **argv_, *optarg_; \
if (argv[0][1] == '-' && !argv[0][2]) { \
- argv++, argc--; break; \
+ (void)optarg_; argv++, argc--; break; \
} \
for (brk_=0, argv[0]++, argv_=argv; argv[0][0] && !brk_; argv[0]++) { \
if (argv_ != argv) break; \
#include <sys/types.h>
#include <sys/wait.h>
+char* ARGV0;
+
typedef struct {
enum {
COMPLETE=0, MATCHES, IS, ISSET, ISDIR, ISFILE,
exit(1);
}
+char* type2str(int type) {
+ switch (type) {
+ case COMPLETE: return "COMPLETE";
+ case MATCHES: return "MATCHES";
+ case IS: return "IS";
+ case ISSET: return "ISSET";
+ case ISDIR: return "ISDIR";
+ case ISFILE: return "ISFILE";
+ case SET: return "SET";
+ case UNSET: return "UNSET";
+ case FINDFILE: return "FINDFILE";
+ case EXEC: return "EXEC";
+ case LAUNCH: return "LAUNCH";
+ }
+ return "UNKNOWN";
+}
+
int main(int argc, char** argv) {
- if (argc != 2) usage(argv[0]);
- setenv("data", argv[1], 1);
+ int debug = 0;
+ OPTBEGIN { case 'd': debug = 1; } OPTEND;
+
+ if (!argc) usage(ARGV0);
+ setenv("data", *argv, 1);
+
+ if (debug)
+ printf("Data: '%s'\n", *argv);
for (unsigned int i = 0; i < nelem(BuiltinRules); i++) {
Rule* rule = BuiltinRules[i];
+ if (debug)
+ printf("\nRuleset %d:\n", i);
for (; rule->type != COMPLETE; rule++) {
- //printf("%d '%s' '%s'\n", rule->type, rule->arg1, rule->arg2);
+ if (debug)
+ printf(" %s '%s' '%s'\n", type2str(rule->type), rule->arg1, rule->arg2);
if (!apply_rule(rule))
break;
}
- //puts("");
if (rule->type == COMPLETE)
exit(0);
}