~rjarry/dlrepo

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH dlrepo] cli: print URL info to stderr

Details
Message ID
<20241007131034.3578809-1-julien.floret@6wind.com>
DKIM signature
pass
Download raw message
Patch: +6 -6
Sometimes, we just want to use the output of dlrepo-cli commands in a
script (for example to iterate through all jobs of a tag) without
the hassle of the json format. In those cases, the "URL:" line is just
annoying. Let's print it to stderr to separate it from the actual
output.

Signed-off-by: Julien Floret <julien.floret@6wind.com>
Acked-by: Thomas Faivre <thomas.faivre@6wind.com>
---
 dlrepo-cli | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlrepo-cli b/dlrepo-cli
index 266446edab2f..1396ba80993d 100755
--- a/dlrepo-cli
+++ b/dlrepo-cli
@@ -221,7 +221,7 @@ def get_info(args):
    if args.raw_json:
        print(json.dumps(data, indent=2))
    else:
        print("URL: %s" % client.make_url(url))
        print("URL: %s" % client.make_url(url), file=sys.stderr)
        for k, v in data["job"].items():
            if isinstance(v, list):
                v = " ".join(v)
@@ -307,7 +307,7 @@ def get_description(args):
    if args.raw_json:
        print(json.dumps(data, indent=2))
    else:
        print("URL: %s" % client.make_url(url))
        print("URL: %s" % client.make_url(url), file=sys.stderr)
        description = data.get("tag", {}).get("description")
        if description is not None:
            print(description)
@@ -340,7 +340,7 @@ def branches(args):
    if args.raw_json:
        print(json.dumps(data, indent=2))
    else:
        print("URL: %s" % client.make_url(url))
        print("URL: %s" % client.make_url(url), file=sys.stderr)
        if args.verbose:
            out = []
            branch_len = 0
@@ -396,7 +396,7 @@ def tags(args):
    if args.raw_json:
        print(json.dumps(data, indent=2))
    else:
        print("URL: %s" % client.make_url(url))
        print("URL: %s" % client.make_url(url), file=sys.stderr)
        for tag in data["branch"]["tags"]:
            print(tag["name"])

@@ -426,7 +426,7 @@ def jobs(args):
    if args.raw_json:
        print(json.dumps(data, indent=2))
    else:
        print("URL: %s" % client.make_url(url))
        print("URL: %s" % client.make_url(url), file=sys.stderr)
        for job in data["tag"]["jobs"]:
            print(job["name"])

@@ -446,7 +446,7 @@ def status(args):
    if args.raw_json:
        print(json.dumps(data, indent=2))
    else:
        print("URL: %s" % client.make_url(url))
        print("URL: %s" % client.make_url(url), file=sys.stderr)
        print("released=%s" % data["tag"]["released"])
        print("stable=%s" % data["tag"]["stable"])
        print("locked=%s" % data["tag"]["locked"])
-- 
2.39.2

[dlrepo/patches/.build.yml] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D4PLL5QEDVPT.2FWPNE8MAVMPM@fra02>
In-Reply-To
<20241007131034.3578809-1-julien.floret@6wind.com> (view parent)
DKIM signature
missing
Download raw message
dlrepo/patches/.build.yml: SUCCESS in 43s

[cli: print URL info to stderr][0] from [Julien Floret][1]

[0]: https://lists.sr.ht/~rjarry/dlrepo/patches/55364
[1]: julien.floret@6wind.com

✓ #1345691 SUCCESS dlrepo/patches/.build.yml https://builds.sr.ht/~rjarry/job/1345691

Applied: [PATCH dlrepo] cli: print URL info to stderr

Details
Message ID
<173211666395.526349.13518979914876964900@ringo>
In-Reply-To
<20241007131034.3578809-1-julien.floret@6wind.com> (view parent)
DKIM signature
pass
Download raw message
Julien Floret <julien.floret@6wind.com> wrote:
> Sometimes, we just want to use the output of dlrepo-cli commands in a
> script (for example to iterate through all jobs of a tag) without
> the hassle of the json format. In those cases, the "URL:" line is just
> annoying. Let's print it to stderr to separate it from the actual
> output.
>
> Signed-off-by: Julien Floret <julien.floret@6wind.com>
> Acked-by: Thomas Faivre <thomas.faivre@6wind.com>
> ---

Acked-by: Robin Jarry <robin@jarry.cc>

Applied, thanks.

To git@git.sr.ht:~rjarry/dlrepo
   7c9669a881a2..921d420e4aee  main -> main
Reply to thread Export thread (mbox)