Changeset aeb5ffba in rtems for tools/cpu/nios2/nios2gen.c


Ignore:
Timestamp:
Aug 10, 2006, 2:05:57 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
9469043
Parents:
f77424ea
Message:

2006-08-10 Joel Sherrill <joel@…>

  • nios2gen.c: Added some very basic support for --help and --version options along with output that is roughly in GNU format. This is required by help2man. help2man expects this all to be written to stdout instead of stderr so this was changed as well.
  • ChangeLog?: New file.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/cpu/nios2/nios2gen.c

    rf77424ea raeb5ffba  
    6767void usage()
    6868{
    69         fprintf(stderr,
    70 "Please specify the name of a nios2gen PTF file that describes where to\n"
    71 "find the system description PTF from SOPC Builder on the command line.\n");
     69printf(
     70  "Usage: nios2gen [PTFFILE]\n"
     71  "Generate BSP data based upon PTF file from SOPC Builder.\n"
     72  "\n"
     73  "Please specify the name of a nios2gen PTF file that describes where to\n"
     74  "find the system description PTF from SOPC Builder on the command line.\n"
     75);
     76}
     77
     78void version()
     79{
     80printf(
     81  "RTEMS/NIOS nios2gen\n"
     82  "  Copyright (c) 2006 Kolja Waschk rtemsdev/ixo.de\n"
     83  "\n"
     84  "  The license and distribution terms for this file may be\n"
     85  "  found in the file LICENSE in this distribution or at\n"
     86  "  http://www.rtems.com/license/LICENSE.\n"
     87);
    7288}
    7389
     
    88104    };
    89105
     106    if ( !strcmp(argv[1], "--help") || !strcmp(argv[1],"-?") ) {
     107        usage();
     108        return 0;
     109    };
     110
     111    if ( !strcmp(argv[1], "--version") ) {
     112        version();
     113        return 0;
     114    };
     115
    90116    cfg = ptf_parse_file(argv[1]);
    91117    if(cfg == NULL)
Note: See TracChangeset for help on using the changeset viewer.