summaryrefslogtreecommitdiffstats
path: root/tools/cpu/nios2
diff options
context:
space:
mode:
Diffstat (limited to 'tools/cpu/nios2')
-rw-r--r--tools/cpu/nios2/ChangeLog8
-rw-r--r--tools/cpu/nios2/nios2gen.c32
2 files changed, 37 insertions, 3 deletions
diff --git a/tools/cpu/nios2/ChangeLog b/tools/cpu/nios2/ChangeLog
new file mode 100644
index 0000000000..a59b502fb7
--- /dev/null
+++ b/tools/cpu/nios2/ChangeLog
@@ -0,0 +1,8 @@
+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.
+
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)
{