cli: Add option to force names to be treated as filter
authorMichael Hanselmann <hansmi@google.com>
Thu, 7 Apr 2011 15:35:44 +0000 (17:35 +0200)
committerMichael Hanselmann <hansmi@google.com>
Mon, 18 Apr 2011 15:55:40 +0000 (17:55 +0200)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/cli.py

index 50bb158..d6a74e5 100644 (file)
@@ -77,6 +77,7 @@ __all__ = [
   "FIELDS_OPT",
   "FILESTORE_DIR_OPT",
   "FILESTORE_DRIVER_OPT",
+  "FORCE_FILTER_OPT",
   "FORCE_OPT",
   "FORCE_VARIANT_OPT",
   "GLOBAL_FILEDIR_OPT",
@@ -1181,6 +1182,11 @@ POWER_DELAY_OPT = cli_option("--power-delay", dest="power_delay", type="float",
                              default=constants.OOB_POWER_DELAY,
                              help="Time in seconds to wait between power-ons")
 
+FORCE_FILTER_OPT = cli_option("-F", "--filter", dest="force_filter",
+                              action="store_true", default=False,
+                              help=("Whether command argument should be treated"
+                                    " as filter"))
+
 
 #: Options provided by all commands
 COMMON_OPTS = [DEBUG_OPT]