summaryrefslogtreecommitdiffstats
path: root/tools/cpu/nios2/nios2gen.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2006-08-10 14:05:57 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2006-08-10 14:05:57 +0000
commitaeb5ffba573df022598b5a9cbdbe08f0ed7f9b8a (patch)
treef426518f4c4d5f239f513cd826518099963e5499 /tools/cpu/nios2/nios2gen.c
parentf77424ea92021b996c3fdeb7dbf930a2cf71cb80 (diff)
downloadrtems-aeb5ffba573df022598b5a9cbdbe08f0ed7f9b8a.tar.bz2
2006-08-10 Joel Sherrill <joel@oarcorp.com>
* 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.
Diffstat (limited to 'tools/cpu/nios2/nios2gen.c')
-rw-r--r--tools/cpu/nios2/nios2gen.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/tools/cpu/nios2/nios2gen.c b/tools/cpu/nios2/nios2gen.c
index ad9631f5a8..fb271735ca 100644
--- a/tools/cpu/nios2/nios2gen.c
+++ b/tools/cpu/nios2/nios2gen.c
@@ -66,9 +66,25 @@ void read_include_file(struct ptf_item *pi, void *arg)
void usage()
{
- fprintf(stderr,
-"Please specify the name of a nios2gen PTF file that describes where to\n"
-"find the system description PTF from SOPC Builder on the command line.\n");
+printf(
+ "Usage: nios2gen [PTFFILE]\n"
+ "Generate BSP data based upon PTF file from SOPC Builder.\n"
+ "\n"
+ "Please specify the name of a nios2gen PTF file that describes where to\n"
+ "find the system description PTF from SOPC Builder on the command line.\n"
+);
+}
+
+void version()
+{
+printf(
+ "RTEMS/NIOS nios2gen\n"
+ " Copyright (c) 2006 Kolja Waschk rtemsdev/ixo.de\n"
+ "\n"
+ " The license and distribution terms for this file may be\n"
+ " found in the file LICENSE in this distribution or at\n"
+ " http://www.rtems.com/license/LICENSE.\n"
+);
}
/********************************************************/
@@ -87,6 +103,16 @@ int main(int argc, char *argv[])
return -1;
};
+ if ( !strcmp(argv[1], "--help") || !strcmp(argv[1],"-?") ) {
+ usage();
+ return 0;
+ };
+
+ if ( !strcmp(argv[1], "--version") ) {
+ version();
+ return 0;
+ };
+
cfg = ptf_parse_file(argv[1]);
if(cfg == NULL)
{