michaeljmarshall opened a new pull request #10331:
URL: https://github.com/apache/pulsar/pull/10331


   ### Motivation
   
   When using the pulsar-admin cli tool, I noticed several commands that have 
odd formatting. In looking at the source annotations used to generate the 
output for different help commands, I noticed that there was unnecessary 
formatting in the description strings. Given that we already format the output 
here:
   
   
https://github.com/apache/pulsar/blob/d557e0aa286866363bc6261dec87790c055db1b0/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdUsageFormatter.java#L52-L75
   
   We should avoid formatting in the annotations themselves.
   
   An additional benefit of this change is that the `bin/pulsar-admin topics` 
command will return fewer new lines, which should help the command to be more 
readable.
   
   ### Modifications
   
   Remove `\t` and `\n` from annotations and make sure the remaining whitespace 
looks correct.
   
   ### Verifying this change
   
   Built the project and ran `bin/pulsar-admin topics` to see the outcome. Here 
is the before (I ran the command within an `apachepulsar/pulsar:2.7.1` 
container) and after for one of the fixed descriptions:
   
   ```
       revoke-permission      Revoke permissions on a topic 
                           Revoke 
               permissions to a client role on a single topic. If the 
permission 
               
                           was not set at the topic level, but rather at the 
namespace 
               level, this 
                           operation will return an error (HTTP status 
               code 412).
         Usage: revoke-permission [options] persistent://tenant/namespace/topic
           Options:
           * --role
               Client role to which revoke permissions
   ```
   
   ```
       revoke-permission      Revoke permissions on a topic.  Revoke 
permissions 
               to a client role on a single topic. If the permission was not 
set 
               at the topic level, but rather at the namespace level, this 
               operation will return an error (HTTP status code 412).
         Usage: revoke-permission [options] persistent://tenant/namespace/topic
           Options:
           * --role
               Client role to which revoke permissions
   ```
   
   ### Does this pull request potentially affect one of the following parts:
   
   This change only affects the way the admin cli options are rendered. It does 
not change any options.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to