diff --git a/README.md b/README.md index a01bda2c..6ade6eac 100644 --- a/README.md +++ b/README.md @@ -821,6 +821,11 @@ The following are some examples of how publishers might use the By default, the `rsconnect content search` command will return metadata for ALL of the content on a RStudio Connect server, both published and unpublished content. +> **Note:** When using the `--r-version` and `--py-version` flags, users should +> make sure to quote the arguments to avoid conflicting with your shell. For +> example, bash would interpret `--py-version >3.0.0` as a shell redirect because of the +> unquoted `>` character. + ```bash # return only published content $ rsconnect content search --published diff --git a/rsconnect/actions_content.py b/rsconnect/actions_content.py index 2d472e06..c30741de 100644 --- a/rsconnect/actions_content.py +++ b/rsconnect/actions_content.py @@ -345,7 +345,7 @@ def do_filter(item): return compare == 1 elif version_filter.comp == "<": return compare == -1 - elif version_filter.comp == "==": + elif version_filter.comp in ["=", "=="]: return compare == 0 elif version_filter.comp == "<=": return compare <= 0 diff --git a/rsconnect/models.py b/rsconnect/models.py index a0c2c5dc..dce1204b 100644 --- a/rsconnect/models.py +++ b/rsconnect/models.py @@ -11,7 +11,7 @@ from click import ParamType from click.types import StringParamType -_version_search_pattern = r"(^[=><]{1,2})(.*)" +_version_search_pattern = r"(^[=><]{0,2})(.*)" _content_guid_pattern = r"([^,]*),?(.*)" @@ -310,7 +310,11 @@ def convert(self, value, param, ctx): version_search.comp = m.group(1) version_search.vers = m.group(2) - if version_search.comp in ["<<", "<>", "><", ">>", "=<", "=>", "="]: + # default to == if no comparator was provided + if not version_search.comp: + version_search.comp = "==" + + if version_search.comp not in [">", "<", ">=", "<=", "=", "=="]: self.fail("Failed to parse verison filter: %s is not a valid comparitor" % version_search.comp) try: