Repository: conan-io/conan

Issue:
[question] Conan list packages does not match the --help
Running `conan list packages --help` produces...
```
$ conan list  packages --help
usage: conan list packages [-h] [-f FORMAT] [-r REMOTE] [-c] reference

positional arguments:
  reference             Recipe reference or revision, e.g., libyaml/0.2.5 or
                        libyaml/0.2.5#80b7cbe095ac7f38844b6511e69e453a
```
When I run the first example provided it fails.
```
$ conan list  packages -r=conancenter libyaml/0.2.5
ERROR: Invalid 'libyaml/0.2.5' missing revision. Please specify one revision or '#latest' one
```
This seems to be a minor error in the `--help` documentation.
**It should probably be ` e.g., libyaml/0.2.5*, libyam/0.2.5#latest, or  libyaml/0.2.5#80b7cbe095`.**

Providing the revision `#latest` eliminates the error but produces no result.
```
$ conan list  packages -r=conancenter libyaml/0.2.5#latest
conancenter:
  There are no packages
```
Checking the available recipe-revisions.
```
$ conan list recipe-revisions libyaml/0.2.5 -r=conancenter
conancenter:
  libyaml/0.2.5#5bdf6971928f655a994646f8dbb221e4 (2022-01-12 14:26:45 UTC)
  libyaml/0.2.5#edaee18262dfefa593ab650babefc80e (2021-07-18 16:11:03 UTC)
  libyaml/0.2.5#80b7cbe095ac7f38844b6511e69e453a (2020-10-06 11:37:22 UTC)
  libyaml/0.2.5#9e234874df88c3ba7249f6d1368fceaf (2020-07-29 07:53:03 UTC)
```
This suggests that specifying the full reference should work.
```
$ conan list packages -r=conancenter libyaml/0.2.5#80b7cbe095ac7f38844b6511e69e453a
conancenter:
  There are no packages
 ```
 This produces the same result as using `#latest`.
 
 My questions:
 * Is it correct that **There are no packages**
 
- [ ] I've read the [CONTRIBUTING guide](https://github.com/conan-io/conan/blob/develop/.github/CONTRIBUTING.md).


Discussion:
Yes, it is correct. Because both Conan 1.X and Conan 2.0 have a filter to discard binary packages created by the other version. At the moment there are no Conan 2.0 binaries in ConanCenter ready, so it should report "No packages", even if some 1.X binaries are there, because they are completely unusable for 2.0.

The ``conan list`` docstrings need to be fixed though to include the ``#latest``
Can I take this issue?
Sure, thanks @MariaMozgunova ! Make sure to branch from ``develop2`` branch and target the PR to it.
Do I get it right that the only change to be made is to add `#latest` like this (so it is necessary to specify the revision in the `conan list packages` command)?
```
$ conan list  packages --help
usage: conan list packages [-h] [-f FORMAT] [-r REMOTE] [-c] revision

positional arguments:
  revision             Recipe revision, e.g., libyaml/0.2.5#latest or
                       libyaml/0.2.5#80b7cbe095ac7f38844b6511e69e453a
```
Yes, exactly, just a minor correction in the docstring.
Sorry, I think I mistakenly closed the issue, it was not my intention. Reopening.

Resolving patch:
diff --git a/conan/cli/commands/list.py b/conan/cli/commands/list.py
--- a/conan/cli/commands/list.py
+++ b/conan/cli/commands/list.py
@@ -225,12 +225,13 @@ def _list_packages_json(data):
 @conan_subcommand(formatters={"json": _list_packages_json})
 def list_packages(conan_api, parser, subparser, *args):
     """
-    List all the package IDs for a given recipe reference. If the reference doesn't
-    include the recipe revision, the command will retrieve all the package IDs for
-    the most recent revision.
+    List all the package IDs for a given recipe revision.
     """
-    subparser.add_argument("reference", help="Recipe reference or revision, e.g., libyaml/0.2.5 or "
-                                             "libyaml/0.2.5#80b7cbe095ac7f38844b6511e69e453a")
+    subparser.add_argument(
+        "reference",
+        help="Recipe reference and revision, e.g., libyaml/0.2.5#latest or "
+             "libyaml/0.2.5#80b7cbe095ac7f38844b6511e69e453a"
+        )
     _add_remotes_and_cache_options(subparser)
     args = parser.parse_args(*args)
 


Test patch: