Browse Source

[build] Allow command help text URI to be customised via config/branding.h

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
92f3bd901e
2 changed files with 46 additions and 1 deletions
  1. 44
    0
      src/config/branding.h
  2. 2
    1
      src/core/parseopt.c

+ 44
- 0
src/config/branding.h View File

@@ -73,6 +73,50 @@ FILE_LICENCE ( GPL2_OR_LATER );
73 73
  */
74 74
 #define PRODUCT_ERROR_URI "http://ipxe.org/%08x"
75 75
 
76
+/*
77
+ * Command help messages
78
+ *
79
+ * iPXE command help messages include a URI constructed from the
80
+ * command name, such as
81
+ *
82
+ *   "See http://ipxe.org/cmd/vcreate for further information"
83
+ *
84
+ * The iPXE web site includes documentation for the commands provided
85
+ * by the iPXE shell, including:
86
+ *
87
+ * - details of the command syntax (e.g. "vcreate --tag <tag>
88
+ *   [--priority <priority>] <trunk interface>").
89
+ *
90
+ * - example usages of the command (e.g. "vcreate --tag 123 net0")
91
+ *
92
+ * - a formal description of the command (e.g. "Create a VLAN network
93
+ *   interface on an existing trunk network interface. The new network
94
+ *   interface will be named by appending a hyphen and the VLAN tag
95
+ *   value to the trunk network interface name.")
96
+ *
97
+ * - details of the possible exit statuses from the command.
98
+ *
99
+ * - links to documentation for related commands (e.g. "vdestroy")
100
+ *
101
+ * - links to documentation for relevant build options (e.g. "VLAN_CMD").
102
+ *
103
+ * - general hints and tips on using the command.
104
+ *
105
+ * If you want to provide your own documentation for all of the
106
+ * commands provided by the iPXE shell, rather than using the existing
107
+ * support infrastructure provided by http://ipxe.org, then you may
108
+ * define a custom URI to be included within command help messages.
109
+ *
110
+ * Note that the custom URI is a printf() format string which must
111
+ * include a format specifier for the command name.
112
+ *
113
+ * [ Please also note that the existing documentation is licensed
114
+ *   under Creative Commons terms which require attribution to the
115
+ *   iPXE project and prohibit the alteration or removal of any
116
+ *   references to "iPXE". ]
117
+ */
118
+#define PRODUCT_COMMAND_URI "http://ipxe.org/cmd/%s"
119
+
76 120
 #include <config/local/branding.h>
77 121
 
78 122
 #endif /* CONFIG_BRANDING_H */

+ 2
- 1
src/core/parseopt.c View File

@@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
32 32
 #include <ipxe/params.h>
33 33
 #include <ipxe/timer.h>
34 34
 #include <ipxe/parseopt.h>
35
+#include <config/branding.h>
35 36
 
36 37
 /** @file
37 38
  *
@@ -343,7 +344,7 @@ void print_usage ( struct command_descriptor *cmd, char **argv ) {
343 344
 	}
344 345
 	if ( cmd->usage )
345 346
 		printf ( " %s", cmd->usage );
346
-	printf ( "\n\nSee http://ipxe.org/cmd/%s for further information\n",
347
+	printf ( "\n\nSee " PRODUCT_COMMAND_URI " for further information\n",
347 348
 		 argv[0] );
348 349
 }
349 350
 

Loading…
Cancel
Save