1. Add -h / --help to each program
Add this near the top of each main() (after the argc < 2 check or as part of it):

if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "--help") == 0)) {
    printf("Usage: %s [options] [file]\n", argv[0]);
    printf("  -f <char>   set field delimiter (default: tab)\n");
    printf("  -h, --help  show this help\n");
    printf("Reads RDB table from stdin or file, writes to stdout.\n");
    return 0;
}

Tailor the usage line per program. Here are the specific ones:

Program	Usage line
row	row 'col op value' [file]
column	column 'Col1' 'Col2' ... [file]
sorttbl	sorttbl [-r] colname [file]
ptbl	ptbl [file]
headoff	headoff [file]
headon	headon 'Name:Type' ... [file]
addcol	addcol 'Name' 'Type' [file]
uniqtbl	uniqtbl colname [file]
mergetbl	mergetbl [file]

For sorttbl, also add -h recognition in the flag loop:

if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
    printf("Usage: sorttbl [-r] colname [file]\n");
    printf("  -r          reverse sort\n");
    printf("  -f <char>   set field delimiter\n");
    printf("  -h, --help  show this help\n");
    return 0;
}


