|
|
1.1 ! root 1: /* dishhelp.c - */ ! 2: ! 3: #ifndef lint ! 4: static char *rcsid = "$Header: /f/osi/quipu/dish/RCS/dishhelp.c,v 7.4 90/07/09 14:47:05 mrose Exp $"; ! 5: #endif ! 6: ! 7: /* ! 8: * $Header: /f/osi/quipu/dish/RCS/dishhelp.c,v 7.4 90/07/09 14:47:05 mrose Exp $ ! 9: * ! 10: * ! 11: * $Log: dishhelp.c,v $ ! 12: * Revision 7.4 90/07/09 14:47:05 mrose ! 13: * sync ! 14: * ! 15: * Revision 7.3 90/04/18 08:49:34 mrose ! 16: * 6.2 ! 17: * ! 18: * Revision 7.2 90/03/15 11:18:21 mrose ! 19: * quipu-sync ! 20: * ! 21: * Revision 7.1 90/01/11 18:37:37 mrose ! 22: * real-sync ! 23: * ! 24: * Revision 7.0 89/11/23 22:20:03 mrose ! 25: * Release 6.0 ! 26: * ! 27: */ ! 28: ! 29: /* ! 30: * NOTICE ! 31: * ! 32: * Acquisition, use, and distribution of this module and related ! 33: * materials are subject to the restrictions of a license agreement. ! 34: * Consult the Preface in the User's Manual for the full terms of ! 35: * this agreement. ! 36: * ! 37: */ ! 38: ! 39: ! 40: #include "quipu/util.h" ! 41: #include "quipu/name.h" ! 42: ! 43: #define OPT (!frompipe || rps -> ps_byteno == 0 ? opt : rps) ! 44: #define RPS (!frompipe || opt -> ps_byteno == 0 ? rps : opt) ! 45: extern char frompipe; ! 46: extern PS opt, rps; ! 47: #define MAXARG 50 ! 48: ! 49: struct { ! 50: char *command; ! 51: char *args; ! 52: char serv; ! 53: char other; ! 54: char *use; ! 55: ! 56: } help_info[MAXARG]; ! 57: int num_help = 0; ! 58: ! 59: add_dish_help (command,args,serv,other,use) ! 60: char *command; ! 61: char *args; ! 62: char serv; ! 63: char other; ! 64: char *use; ! 65: { ! 66: help_info[num_help].command = command; ! 67: help_info[num_help].args = args; ! 68: help_info[num_help].serv = serv; ! 69: help_info[num_help].other = other; ! 70: help_info[num_help].use = use; ! 71: num_help++; ! 72: } ! 73: ! 74: dish_help_init () { ! 75: add_dish_help ( ! 76: "dish", "[-pipe] [-noconnect] [-user <name>]\n[-password [<password>]] [-call <dsa name>] [-fast]\n[-simple] [-protected] [-strong] [-noauthentication]", FALSE, FALSE, ! 77: "Directory Shell," ); ! 78: add_dish_help ( ! 79: "showentry", "[-[no]cache] [-[no]name] [-[no]move]", TRUE,TRUE, ! 80: "show an entry, read it if not cached," ); ! 81: add_dish_help ( ! 82: "list", "[-nocache] [-noshow] [-[no]move]", TRUE,FALSE, ! 83: "list children of the current node" ); ! 84: add_dish_help ( ! 85: "search", "[-baseobject] [-singlelevel] [-subtree]\n[-filter <filter>]\n[-[no]relative] [-[no]searchaliases] [-[no]partial] [-hitone]", TRUE, TRUE, ! 86: "search the tree for an object," ); ! 87: add_dish_help ( ! 88: "moveto", "[-[no]pwd] [-[no]check] [-sequence <name>] [-nosequence] <position>", FALSE, FALSE, ! 89: "move to position in the DIT" ); ! 90: add_dish_help ( ! 91: "modify", "[-draft <draft> [-noedit]] [-newdraft] ", TRUE, FALSE, ! 92: "modify an existing node," ); ! 93: add_dish_help ( ! 94: "showname", "[-[no]compact] [-[no]cache]", TRUE,TRUE, ! 95: "show the name of an entry," ); ! 96: add_dish_help ( ! 97: "compare", "-attribute <attributeType '=' attributeValue>\n[-[no]print]", TRUE,FALSE, ! 98: "compare attribute with the supplied value," ); ! 99: add_dish_help ( ! 100: "add", "[-draft <draft> [-noedit]] [-template <draft>] [-newdraft]\n [-objectclass <objectclass>]", TRUE,FALSE, ! 101: "add a new node," ); ! 102: add_dish_help ( ! 103: "delete", "", TRUE,FALSE, ! 104: "delete an object," ); ! 105: add_dish_help ( ! 106: "modifyrdn", "-name <attributeType '=' attributeValue> [-[no]delete]", TRUE, FALSE, ! 107: "modify the name of a node," ); ! 108: add_dish_help ( ! 109: "squid", "[-sequence <name>] [-alias <position>] [-version]",FALSE, FALSE, ! 110: "status of dish," ); ! 111: add_dish_help ( ! 112: "bind", "[-noconnect] [[-user] <name>]\n[-password [<password>]] [-[no]refer]\n[-call <dsa name>]\n[-simple] [-protected] [-strong] [-noauthentication]", FALSE, FALSE, ! 113: "connect to the directory," ); ! 114: add_dish_help ( ! 115: "unbind", "[-noquit]", FALSE, FALSE, ! 116: "disconnect from the directory," ); ! 117: add_dish_help ( ! 118: "fred", "[-dm2dn <domain>] [-ufn <name...>]", FALSE, FALSE, ! 119: "back-end to FrED," ); ! 120: add_dish_help ( ! 121: "dsacontrol", "[-[un]lock <entry>] [-dump <directory>]\n[-tailor <string>] [-abort] [-restart] [-info]\n[-refresh <entry>] [-resync <entry>] [-slave [<entry>]]", FALSE, FALSE, ! 122: "control the operation of the DSA (managers only)," ); ! 123: }; ! 124: ! 125: Usage (rtn) ! 126: char *rtn; ! 127: { ! 128: extern DN dn, ! 129: savename; ! 130: int i; ! 131: ! 132: dn_free (dn); ! 133: dn = savename; ! 134: savename = NULLDN; ! 135: ! 136: if (print_arg_error (OPT) == OK) ! 137: return; ! 138: ! 139: for (i = 0; help_info[i].command != 0; i++) ! 140: if (strcmp (help_info[i].command, rtn) == 0) { ! 141: if (help_info[i].serv) { ! 142: ps_printf (OPT, "Usage %s [-help] [<object>] %s \n", rtn, help_info[i].args); ! 143: print_other(OPT, help_info[i].other); ! 144: ps_printf (OPT, "\n[<service controls>]\n"); ! 145: } else ! 146: ps_printf (OPT, "Usage %s [-help] %s\n", rtn, help_info[i].args); ! 147: return; ! 148: } ! 149: ps_print (OPT, "Usage...\n"); ! 150: } ! 151: ! 152: help_arg (rtn) ! 153: char *rtn; ! 154: { ! 155: int i; ! 156: ! 157: for (i = 0; help_info[i].command != 0; i++) ! 158: if (strcmp (help_info[i].command, rtn) == 0) { ! 159: if (help_info[i].serv) { ! 160: ps_printf (RPS, "%-10s - %s\n[<object>] %s ", rtn, help_info[i].use,help_info[i].args); ! 161: print_other(RPS,help_info[i].other); ! 162: ps_print (RPS,"\n"); ! 163: print_service(); ! 164: } else ! 165: ps_printf (RPS, "%-10s - %s\n%s\n", rtn, help_info[i].use,help_info[i].args); ! 166: return; ! 167: } ! 168: ps_print (OPT,"Sorry - No help available\n"); ! 169: } ! 170: ! 171: print_other (aps,x) ! 172: PS aps; ! 173: char x; ! 174: { ! 175: if (x == FALSE) ! 176: return; ! 177: ! 178: ps_print (aps,"\n[-[no]types <attribute-type> *] [-[no]all]\n[-[no]value] [-[no]show] \n[-[no]key] [-edb]\n[-proc <syntax> <process>]"); ! 179: } ! 180: ! 181: print_service () ! 182: { ! 183: ps_print (RPS,"[-sequence <name>] [-nosequence]\n"); ! 184: ps_print (RPS,"[-[no]preferchain] [-[no]chaining]\n"); ! 185: ps_print (RPS,"[-[dont]usecopy] [-[dont]dereferencealias]\n"); ! 186: ps_print (RPS,"[-low] [-medium] [-high]\n"); ! 187: ps_print (RPS,"[-timelimit n] [-notimelimit]\n"); ! 188: ps_print (RPS,"[-sizelimit n] [-nosizelimit]\n"); ! 189: ps_print (RPS,"[-strong] [-[no]refer]\n"); ! 190: ps_print (RPS,"[-[no]localscope] [-help]\n"); ! 191: ! 192: } ! 193: ! 194: call_help () ! 195: { ! 196: int i; ! 197: ! 198: ps_print (RPS, "The following commands are recognised...\n\n"); ! 199: ! 200: for (i = 0; help_info[i].command != 0; i++) ! 201: ps_printf (RPS, "%-10s - %s\n", help_info[i].command, help_info[i].use); ! 202: ! 203: ps_print (RPS,"\nEnter <command> -help for help on that command\n"); ! 204: ps_print (RPS, "See the DISH manual for full details\n\n"); ! 205: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.