Changeset 13555
- Timestamp:
- May 30, 2007, 12:43:58 PM (19 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 2 edited
-
psArguments.c (modified) (2 diffs)
-
psArguments.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psArguments.c
r13521 r13555 7 7 * @author David Robbins, MHPCC 8 8 * 9 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $10 * @date $Date: 2007-05- 25 04:15:46$9 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2007-05-30 22:43:58 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 506 506 } 507 507 508 void psArgumentHelpSimple(psMetadata *arguments) 509 { 510 PS_ASSERT_PTR_NON_NULL(arguments, ); 511 512 printf("Optional arguments:\n"); 513 int maxName = 4; // Maximum length of a name 514 int maxValue = 4; // Maximum length of a value 515 516 // First pass to get the sizes 517 maxLength(&maxName, &maxValue, arguments); 518 519 // Second pass to print 520 psMetadataIterator *iter = psMetadataIteratorAlloc(arguments, PS_LIST_HEAD, NULL); 521 psMetadataItem *item = NULL; // Item from iterator 522 while ((item = psMetadataGetAndIncrement(iter))) { 523 // Initial indent + name + indent + comment 524 printf("%*s%*s%*s%s\n", 525 NUM_SPACES, " ", 526 maxName, argItem->name, 527 NUM_SPACES, " ", 528 argItem->comment); 529 } 530 531 psFree(iter); 532 } 533 -
trunk/psLib/src/types/psArguments.h
r11248 r13555 5 5 * @author David Robbins, MHPCC 6 6 * 7 * @version $Revision: 1. 4$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-0 1-23 22:47:23$7 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-05-30 22:43:58 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 72 72 ); 73 73 74 /** Prints to stdout a simplifed guide to the command-line arguments. */ 75 void psArgumentHelpSimple( 76 psMetadata *arguments ///< metadata container for arguments 77 ); 78 74 79 /// @} 75 80 #endif // #ifndef PS_ARGUMENTS_H
Note:
See TracChangeset
for help on using the changeset viewer.
