[ 
https://issues.apache.org/jira/browse/ARTEMIS-4819?focusedWorklogId=923913&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-923913
 ]

ASF GitHub Bot logged work on ARTEMIS-4819:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Jun/24 14:40
            Start Date: 18/Jun/24 14:40
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on PR #4980:
URL: 
https://github.com/apache/activemq-artemis/pull/4980#issuecomment-2176275423

   > I don't really think that it is in a spirit of Bash shell scripting.
   
   I'm not heavy into Bash shell scripting so I may not be the best judge of 
it's "spirit," but the fact that the [`jq`](https://jqlang.github.io/jq/) 
command exists and appears to be popular indicates that lots of folks are 
dealing with JSON from the shell.
   
   > It also assumes that jq or any other JSON tool is available, which is not 
necessary true.
   
   That's true, but given the popularity of JSON I think that's a relatively 
safe assumption.
   
   > If you are worried that proposed output is not clear or pretty, another 
way to go could be to add additional flag to output the list without 
decorations.
   
   My chief concern is that we don't needlessly complicate something that was 
designed to be very simple. If you want to treat the output of the CLI as an 
API (i.e. to be used in scripts and other commands) then you can't simply 
change it between minor versions because you'll break anybody who is already 
relying on the existing output format. If you want to eventually replace the 
existing output you must first deprecate it and provide a new flag or command. 
Then when a new major version is released we can remove the deprecated item. 
You can see how a small change like this can grow into something much larger. 
Of course, that's not to mention the subjective evaluation of what is _clear_ 
or _pretty_.
   
   Ultimately I think we should encourage folks to use tools the way they were 
designed to be used. In short, use the management API if you need an API and 
use the CLI for simple, human tasks. I recently [clarified the 
documentation](https://github.com/apache/activemq-artemis/blob/main/docs/user-manual/using-cli.adoc#command-line-interface)
 to this end.




Issue Time Tracking
-------------------

    Worklog Id:     (was: 923913)
    Time Spent: 40m  (was: 0.5h)

> Improve user list output in CLI
> -------------------------------
>
>                 Key: ARTEMIS-4819
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4819
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Vilius Šumskas
>            Priority: Minor
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Currently  `artemis user list` command output is not very script friendly. It 
> prints users like this:
> {noformat}
> "krttmtr5zh3yx1j"(role_adm_krttmtr5zh3yx1j)
> "wge4qbpzykuqety"(role_adm_wge4qbpzykuqety)
> "8wezkl4yg0wmmcr"(role_adm_8wezkl4yg0wmmcr)
> "atrnohhggvhocqq"(role_adm_atrnohhggvhocqq){noformat}
> My proposal is to split users and roles with a space like this, so that the 
> output can be parsed and used in bash scripts more effectively:
> {noformat}
> krttmtr5zh3yx1j (role_adm_krttmtr5zh3yx1j)
> wge4qbpzykuqety (role_adm_wge4qbpzykuqety)
> 8wezkl4yg0wmmcr(role_adm_8wezkl4yg0wmmcr)
> atrnohhggvhocqq (role_adm_atrnohhggvhocqq){noformat}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@activemq.apache.org
For additional commands, e-mail: issues-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to