Patchwork [4/5] wic: Add dummy subcommand and usage strings

login
register
mail settings
Submitter tom.zanussi@linux.intel.com
Date July 8, 2014, 2:51 p.m.
Message ID <b9fcd4f65c6487d2ffa6e8496b0ac618b45b90b6.1404830754.git.tom.zanussi@linux.intel.com>
Download mbox | patch
Permalink /patch/75193/
State Accepted
Commit f2ab61968129c6c15b0a61968a7761ccce5a469a
Headers show

Comments

tom.zanussi@linux.intel.com - July 8, 2014, 2:51 p.m.
In order to reuse the existing subcommand infrastructure to display
various general-purpose help topics, add a dummy 'help_topic'
subcommand and usage string.  This allows users to invoke general help
topics by the natural form 'wic help <topic>' even though topic
doesn't correspond to a real subcommand.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
 scripts/wic | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Patch

diff --git a/scripts/wic b/scripts/wic
index 2d3fd09..00eddfd 100755
--- a/scripts/wic
+++ b/scripts/wic
@@ -226,6 +226,19 @@  def wic_list_subcommand(args, usage_str):
         sys.exit(1)
 
 
+def wic_help_topic_subcommand(args, usage_str):
+    """
+    Command-line handling for help-only 'subcommands'.  This is
+    essentially a dummy command that doesn nothing but allow users to
+    use the existing subcommand infrastructure to display help on a
+    particular topic not attached to any particular subcommand.
+    """
+    pass
+
+
+wic_help_topic_usage = """
+"""
+
 subcommands = {
     "create": [wic_create_subcommand,
                wic_create_usage,