Repository: conan-io/conan

Issue:
A form of conan remote list that can be used with conan config install
See https://github.com/conan-io/docs/issues/697 for further discussion/motivation, but basically the idea is that the output of `conan remote list` is not compatible with the format of `remotes.txt` expected for use with `conan config install`.

It could be nice to have a modified version of `conan remote list` (@memsharded has suggested `conan remote list --raw`) so that 
```bash
    conan remote list --raw > remotes.txt
```
can conveniently format a user's remotes for use in a packaged Conan client config. 


Discussion:

Resolving patch:
diff --git a/conans/client/command.py b/conans/client/command.py
--- a/conans/client/command.py
+++ b/conans/client/command.py
@@ -965,7 +965,9 @@ def remote(self, *args):
         subparsers = parser.add_subparsers(dest='subcommand', help='sub-command help')
 
         # create the parser for the "a" command
-        subparsers.add_parser('list', help='List current remotes')
+        parser_list = subparsers.add_parser('list', help='List current remotes')
+        parser_list.add_argument("-raw", "--raw", action='store_true', default=False,
+                                 help='Raw format. Valid for "remotes.txt" file for "conan config install"')
         parser_add = subparsers.add_parser('add', help='Add a remote')
         parser_add.add_argument('remote', help='Name of the remote')
         parser_add.add_argument('url', help='URL of the remote')
@@ -1014,7 +1016,7 @@ def remote(self, *args):
 
         if args.subcommand == "list":
             remotes = self._conan.remote_list()
-            self._outputer.remote_list(remotes)
+            self._outputer.remote_list(remotes, args.raw)
         elif args.subcommand == "add":
             return self._conan.remote_add(remote, url, verify_ssl, args.insert, args.force)
         elif args.subcommand == "remove":
diff --git a/conans/client/conan_command_output.py b/conans/client/conan_command_output.py
--- a/conans/client/conan_command_output.py
+++ b/conans/client/conan_command_output.py
@@ -24,9 +24,12 @@ def profile_list(self, profiles):
         for p in sorted(profiles):
             self.user_io.out.info(p)
 
-    def remote_list(self, remotes):
+    def remote_list(self, remotes, raw):
         for r in remotes:
-            self.user_io.out.info("%s: %s [Verify SSL: %s]" % (r.name, r.url, r.verify_ssl))
+            if raw:
+                self.user_io.out.info("%s %s %s" % (r.name, r.url, r.verify_ssl))
+            else:
+                self.user_io.out.info("%s: %s [Verify SSL: %s]" % (r.name, r.url, r.verify_ssl))
 
     def remote_ref_list(self, refs):
         for ref, remote in refs.items():


Test patch:
diff --git a/conans/test/command/remote_test.py b/conans/test/command/remote_test.py
--- a/conans/test/command/remote_test.py
+++ b/conans/test/command/remote_test.py
@@ -2,6 +2,7 @@
 from conans.test.utils.tools import TestClient, TestServer
 from collections import OrderedDict
 from conans.util.files import load
+import re
 
 
 class RemoteTest(unittest.TestCase):
@@ -16,6 +17,13 @@ def setUp(self):
 
         self.client = TestClient(servers=self.servers, users=self.users)
 
+    def list_raw_test(self):
+        self.client.run("remote list --raw")
+        output = re.sub("http:\/\/fake.+\.com", "http://fake.com", str(self.client.out))
+        self.assertIn("remote0 http://fake.com True", output)
+        self.assertIn("remote1 http://fake.com True", output)
+        self.assertIn("remote2 http://fake.com True", output)
+
     def basic_test(self):
         self.client.run("remote list")
         self.assertIn("remote0: http://", self.client.user_io.out)