]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Allow command help text URI to be customised via config/branding.h
authorMichael Brown <mcb30@ipxe.org>
Wed, 11 Feb 2015 13:49:02 +0000 (13:49 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 11 Feb 2015 14:11:28 +0000 (14:11 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/config/branding.h
src/core/parseopt.c

index 4bd7e3cc786b77cd801b42f83444bb2d69317f6d..43f7592dff4efbec263005031506b4ce13331243 100644 (file)
@@ -73,6 +73,50 @@ FILE_LICENCE ( GPL2_OR_LATER );
  */
 #define PRODUCT_ERROR_URI "http://ipxe.org/%08x"
 
+/*
+ * Command help messages
+ *
+ * iPXE command help messages include a URI constructed from the
+ * command name, such as
+ *
+ *   "See http://ipxe.org/cmd/vcreate for further information"
+ *
+ * The iPXE web site includes documentation for the commands provided
+ * by the iPXE shell, including:
+ *
+ * - details of the command syntax (e.g. "vcreate --tag <tag>
+ *   [--priority <priority>] <trunk interface>").
+ *
+ * - example usages of the command (e.g. "vcreate --tag 123 net0")
+ *
+ * - a formal description of the command (e.g. "Create a VLAN network
+ *   interface on an existing trunk network interface. The new network
+ *   interface will be named by appending a hyphen and the VLAN tag
+ *   value to the trunk network interface name.")
+ *
+ * - details of the possible exit statuses from the command.
+ *
+ * - links to documentation for related commands (e.g. "vdestroy")
+ *
+ * - links to documentation for relevant build options (e.g. "VLAN_CMD").
+ *
+ * - general hints and tips on using the command.
+ *
+ * If you want to provide your own documentation for all of the
+ * commands provided by the iPXE shell, rather than using the existing
+ * support infrastructure provided by http://ipxe.org, then you may
+ * define a custom URI to be included within command help messages.
+ *
+ * Note that the custom URI is a printf() format string which must
+ * include a format specifier for the command name.
+ *
+ * [ Please also note that the existing documentation is licensed
+ *   under Creative Commons terms which require attribution to the
+ *   iPXE project and prohibit the alteration or removal of any
+ *   references to "iPXE". ]
+ */
+#define PRODUCT_COMMAND_URI "http://ipxe.org/cmd/%s"
+
 #include <config/local/branding.h>
 
 #endif /* CONFIG_BRANDING_H */
index d268c05947ad6f20e0eecbf086c92f4143bfb8cc..2c853eeaf201647c42e9b6107a185c16bc7f7c54 100644 (file)
@@ -32,6 +32,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <ipxe/params.h>
 #include <ipxe/timer.h>
 #include <ipxe/parseopt.h>
+#include <config/branding.h>
 
 /** @file
  *
@@ -343,7 +344,7 @@ void print_usage ( struct command_descriptor *cmd, char **argv ) {
        }
        if ( cmd->usage )
                printf ( " %s", cmd->usage );
-       printf ( "\n\nSee http://ipxe.org/cmd/%s for further information\n",
+       printf ( "\n\nSee " PRODUCT_COMMAND_URI " for further information\n",
                 argv[0] );
 }