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

ASF GitHub Bot logged work on AVRO-3330:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Jan/22 17:37
            Start Date: 28/Jan/22 17:37
    Worklog Time Spent: 10m 
      Work Description: KyleSchoonover commented on a change in pull request 
#1481:
URL: https://github.com/apache/avro/pull/1481#discussion_r794715971



##########
File path: lang/csharp/src/apache/codegen/AvroGen.cs
##########
@@ -29,7 +29,8 @@ static int Main(string[] args)
             if (args.Length == 0 || args[0] == "-h" || args[0] == "--help")
             {
                 Usage();
-                return 1;
+                // Return success if help requested
+                return args.Length == 0 ? 1 : 0;

Review comment:
       `// Print usage if no arguments provided or help requested
               if (args.Length == 0)
               {
                   Usage();
                   return 1;
               }
   
               if (args[0] == "-h" || args[0] == "--help")
               {
                   Usage();
                   return 0;
               }`
   
   This seems cleaner.  No reason to add another evaluation.




-- 
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.

To unsubscribe, e-mail: [email protected]

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


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

            Worklog Id:     (was: 717172)
    Remaining Estimate: 40m  (was: 50m)
            Time Spent: 20m  (was: 10m)

> Avrogen avsc compiler should return 0 exit code if help requested
> -----------------------------------------------------------------
>
>                 Key: AVRO-3330
>                 URL: https://issues.apache.org/jira/browse/AVRO-3330
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: c++, csharp
>            Reporter: Zoltan Csizmadia
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.11.1
>
>   Original Estimate: 1h
>          Time Spent: 20m
>  Remaining Estimate: 40m
>
> It is a standard behaviour that if a help requested from a tool by (-h, 
> –help), the return code is 0. If ana rgument is needed, but the tool was 
> executed without arguments, the return code is non zero (1).
> E.g. this  feature can be used to check if the tool is available, by running 
> requesting its help.  Without using OS specific "which" (Linux) or "where" 
> (Windows).
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to