Lines Matching refs:subcommand
59 /* standard subcommand options table to support -? */
149 * arg - pointer to array of char containing subcommand string
151 * subcommand - pointer to subcommand_t pointer
152 * on success, contains the matching subcommand structure based on
153 * input subcommand name
160 getSubcommand(char *arg, subcommand_t **subcommand)
169 *subcommand = sp;
179 * subcommand - subcommand for which to get options
187 getOptions(uint_t object, uint_t subcommand)
193 (op->subcommandValue == subcommand)) {
245 * Print usage for a subcommand.
249 * subcommand - pointer to subcommand_t structure
256 subUsage(uint_t usageType, subcommand_t *subcommand)
263 gettext("Usage"), commandName, subcommand->name);
296 subUsageObject(usageType, subcommand, objp);
301 * Print usage for a subcommand and object.
305 * subcommand - pointer to subcommand_t structure
313 subUsageObject(uint_t usageType, subcommand_t *subcommand, object_t *objp)
325 * internal subcommand rules table error
333 if (opCmd->invOpCmd & subcommand->value) {
337 options = getOptions(objp->value, subcommand->value);
339 /* print generic subcommand usage */
340 (void) fprintf(stdout, "\t%s %s ", commandName, subcommand->name);
361 if (opCmd->optOpCmd & subcommand->value) {
364 if (!(opCmd->noOpCmd & subcommand->value)) {
377 if (opCmd->multOpCmd & subcommand->value) {
380 if (!(opCmd->noOpCmd & subcommand->value)) {
383 if (opCmd->optOpCmd & subcommand->value) {
392 /* print options for subcommand, object */
431 subcommand_t subcommand;
457 /* print all subcommand usage */
459 subcommand.name = sp->name;
460 subcommand.value = sp->value;
464 subUsage(usageType, &subcommand);
504 * subcommand and object usage respectively.
510 * command subcommand object [<options>] [<operand>]
513 * -?, --help Provides usage on a command or subcommand
524 * callArgs - void * passed by caller to be passed to subcommand function
527 * funcRet - pointer to int that holds subcommand function return value
557 subcommand_t *subcommand;
604 * load standard subcommand options to internal long options table
670 * subcommand is always in the second argument. If there is no
671 * recognized subcommand in the second argument, print error,
674 if (getSubcommand(argv[1], &subcommand) != 0) {
676 commandName, gettext("invalid subcommand"));
684 subUsage(GENERAL_USAGE, subcommand);
703 subUsage(HELP_USAGE, subcommand);
706 subUsage(GENERAL_USAGE, subcommand);
718 * help usage for the subcommand and then return.
723 subUsage(HELP_USAGE, subcommand);
729 * internal subcommand rules table error
740 if (opCmd->invOpCmd & subcommand->value) {
742 gettext("invalid subcommand for"), object->name);
743 subUsage(HELP_USAGE, subcommand);
783 * and subcommand (option rules table) for validity.
792 subcommand, object);
795 subUsage(GENERAL_USAGE, subcommand);
827 /* get option string for this object and subcommand */
828 availOptions = getOptions(object->value, subcommand->value);
834 subUsageObject(HELP_USAGE, subcommand, object);
855 subUsageObject(DETAIL_USAGE, subcommand,
868 subUsageObject(DETAIL_USAGE, subcommand,
879 subUsageObject(DETAIL_USAGE, subcommand,
890 (opCmd->reqOpCmd & subcommand->value)) {
892 commandName, subcommand->name,
894 subUsageObject(HELP_USAGE, subcommand, object);
903 (opCmd->noOpCmd & subcommand->value)) {
905 commandName, subcommand->name,
907 subUsageObject(HELP_USAGE, subcommand, object);
916 !(opCmd->multOpCmd & subcommand->value)) {
918 commandName, subcommand->name, object->name,
920 subUsageObject(HELP_USAGE, subcommand, object);
928 *funcRet = subcommand->handler(argc - operInd, &argv[operInd],