cstamas commented on code in PR #11948:
URL: https://github.com/apache/maven/pull/11948#discussion_r3101964662


##########
maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java:
##########
@@ -109,7 +109,11 @@ public class CLIManager {
 
     public static final String IGNORE_TRANSITIVE_REPOSITORIES = "itr";
 
-    private static final String RAW_STREAMS = "raw-streams";
+    public static final String RAW_STREAMS = "raw-streams";
+
+    public static final String ARTIFACTS_UPDATE_POLICY = 
"artifacts-update-policy";
+
+    public static final String METADATA_UPDATE_POLICY = 
"metadata-update-policy";

Review Comment:
   I wanted an option like `-U` is but more versatile:
   * `-mup` would work like `-U` (set always for metadata)
   * but optionally, user could set actual policy `-mup never` or `-mup always`
   
   But the problem with optional support in Commons CLI, is that it does not 
work like? Or at least I could not make it work, ie CLI like this `mvn -mup 
clean` would assume "clean" is a policy and it would explode (unknown policy 
"clean").
   
   So, I ended up with long options with mandatory param that is nice and 
explicit `--metadata-update-policy=never`, and on CLI this is also clear `mvn 
--metadata-update-policy=never clean` and it is perfectly clear what is written 
here.



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

Reply via email to