Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize main annotations #13727

Closed
wants to merge 121 commits into from

Commits on Feb 6, 2022

  1. Configuration menu
    Copy the full SHA
    3673ccf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    65785d4 View commit details
    Browse the repository at this point in the history
  3. Allow no parameters

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    e9db3d0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5d3c199 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6161b9b View commit details
    Browse the repository at this point in the history
  6. Update MiMa filters

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    959aff9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    81c88c1 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2fbdf66 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    098fd27 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    754a6d0 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    c8210d5 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b727dab View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    ad291f2 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    c68d6f0 View commit details
    Browse the repository at this point in the history
  15. Extract run into main

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    1ca13aa View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    891c6e4 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    d35237e View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    1ebf1e5 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    58d5460 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    652e1e0 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    8ac03b7 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    b9cc156 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    e7d9bba View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    a05c4f1 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    cb4bb20 View commit details
    Browse the repository at this point in the history
  26. Remove debug println

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    c5bed16 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    c0d80d3 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    c22d360 View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    884ea20 View commit details
    Browse the repository at this point in the history
  30. Generate class instead of object, instanciate main

    - This allows for top-level main methods without name conflict with the companion object
    - Instead of extending main, instanciate a new main and call command on it
    - Will need to instanciate the @ class instead of @main (allowing easy overriding of methods)
    - Will need to check if not extending main is an issue
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    f18b3a4 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    a3748d0 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    a60bd11 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    989bcfa View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    26b2d63 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    45f7ba2 View commit details
    Browse the repository at this point in the history
  36. Add support for default values

    main-annotation* tests now all pass again
    
    This is quite messy, it should most probably be cleaned or done in a cleaner way
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    62b1670 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    45490a9 View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    7cf2f7f View commit details
    Browse the repository at this point in the history
  39. Fix help test

    The "This should not be printed!" lines are, in fact, printed in IDEs
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    0ab2c43 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    0657c64 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    ce7471a View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    8ed3a9f View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    8b68474 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    7eb8c0c View commit details
    Browse the repository at this point in the history
  45. Factorize getter code, check duplicate named param

    - Extract argGetter and argGetterDefault into a helper method
    - When using multiple times the same arg by name, display an error
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    91f5ee4 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    cd5674e View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    ccfe578 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    8b42578 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    91f6d55 View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    87f9c09 View commit details
    Browse the repository at this point in the history
  51. Factorize createArgs

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    78fa961 View commit details
    Browse the repository at this point in the history
  52. Rework of Arguments, change usage format

    - Remove "case" keywork for Argument subclasses to avoid unapply pattern matching (future compatibility)
    - Change output of usage function to be more expressive
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    a65b76f View commit details
    Browse the repository at this point in the history
  53. Configuration menu
    Copy the full SHA
    52ef5dc View commit details
    Browse the repository at this point in the history
  54. Configuration menu
    Copy the full SHA
    75e06a1 View commit details
    Browse the repository at this point in the history
  55. Make defaultValue by-name param

    Co-authored-by: Nicolas Stucki <nicolas.stucki@gmail.com>
    timotheeandres and nicolasstucki committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    395fd14 View commit details
    Browse the repository at this point in the history
  56. Remove redundant val in ExitCode

    Co-authored-by: Nicolas Stucki <nicolas.stucki@gmail.com>
    timotheeandres and nicolasstucki committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    f300597 View commit details
    Browse the repository at this point in the history
  57. Configuration menu
    Copy the full SHA
    45acb09 View commit details
    Browse the repository at this point in the history
  58. Configuration menu
    Copy the full SHA
    6de547f View commit details
    Browse the repository at this point in the history
  59. Configuration menu
    Copy the full SHA
    70ee28a View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    50de840 View commit details
    Browse the repository at this point in the history
  61. Make Command a trait

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    6bc549b View commit details
    Browse the repository at this point in the history
  62. Fix issue where map is not member of Array[String | Null] | Null

    - This was caused by changes in issue scala#13729
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    1b9c952 View commit details
    Browse the repository at this point in the history
  63. Configuration menu
    Copy the full SHA
    de93b4d View commit details
    Browse the repository at this point in the history
  64. Configuration menu
    Copy the full SHA
    bbcf4ea View commit details
    Browse the repository at this point in the history
  65. Make main class final

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    bdddb3f View commit details
    Browse the repository at this point in the history
  66. Factorize code of main

    - Now that main is final, the code can be factorized
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    88a76df View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    f2bafb4 View commit details
    Browse the repository at this point in the history
  68. Configuration menu
    Copy the full SHA
    3cd2a88 View commit details
    Browse the repository at this point in the history
  69. Configuration menu
    Copy the full SHA
    c4a6ff0 View commit details
    Browse the repository at this point in the history
  70. Configuration menu
    Copy the full SHA
    7b685c4 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    a6e9da9 View commit details
    Browse the repository at this point in the history
  72. Configuration menu
    Copy the full SHA
    5065a09 View commit details
    Browse the repository at this point in the history
  73. Configuration menu
    Copy the full SHA
    63f30f8 View commit details
    Browse the repository at this point in the history
  74. Update MiMa filters

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    de73f3c View commit details
    Browse the repository at this point in the history
  75. Configuration menu
    Copy the full SHA
    2cad3dc View commit details
    Browse the repository at this point in the history
  76. Pass doc to command; main parameter for line length

    - Instead of passing arg docs to the args, pass the whole docstring to the command function and parse it on run
    - Add parameter in main to control max line width when printing
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    d32868a View commit details
    Browse the repository at this point in the history
  77. Configuration menu
    Copy the full SHA
    4d4418e View commit details
    Browse the repository at this point in the history
  78. Configuration menu
    Copy the full SHA
    bded202 View commit details
    Browse the repository at this point in the history
  79. Configuration menu
    Copy the full SHA
    aff99de View commit details
    Browse the repository at this point in the history
  80. Remove ExitCode and result printing in main

    - After discussing with LAMP members, I was instructed to not print the result of a main method
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    889dbd6 View commit details
    Browse the repository at this point in the history
  81. Configuration menu
    Copy the full SHA
    4d0c149 View commit details
    Browse the repository at this point in the history
  82. Configuration menu
    Copy the full SHA
    1be2e7d View commit details
    Browse the repository at this point in the history
  83. Configuration menu
    Copy the full SHA
    8161163 View commit details
    Browse the repository at this point in the history
  84. Factorize annotation instanciation code

    - Tweak code for default values, add support for varargs
    - Add related tests
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    eafa508 View commit details
    Browse the repository at this point in the history
  85. Pass object to argGetter instead of multiple params

    - Instead of adding to the list of elements when we add functionalities to the getter functions, we now pass an object
      containing the values. That way, adding an argument is a matter of expanding the class ParameterInfos and adding a
      few lines in MainProxies
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    99d9c12 View commit details
    Browse the repository at this point in the history
  86. Configuration menu
    Copy the full SHA
    282bfc6 View commit details
    Browse the repository at this point in the history
  87. Configuration menu
    Copy the full SHA
    0d1d1f9 View commit details
    Browse the repository at this point in the history
  88. Add main.Arg annotation for argument-related parameters

    - Add annotation for main method arguments
    - Add support for alternative names and short names
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    c8584df View commit details
    Browse the repository at this point in the history
  89. Configuration menu
    Copy the full SHA
    d1ab483 View commit details
    Browse the repository at this point in the history
  90. Configuration menu
    Copy the full SHA
    f2b5287 View commit details
    Browse the repository at this point in the history
  91. Configuration menu
    Copy the full SHA
    635b79e View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    485d9f8 View commit details
    Browse the repository at this point in the history
  93. Configuration menu
    Copy the full SHA
    1e71cb2 View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    b4dc846 View commit details
    Browse the repository at this point in the history
  95. Use default values' symbols instead of trees

    - This avoids having to somehow retype the value
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    760f49c View commit details
    Browse the repository at this point in the history
  96. Change structure of ParameterInfos

    - Based on suggestion by Nicolas Stucki, here: https://gist.github.com/nicolasstucki/84ebcd5c2cfc9aa14abba96ae1a0e996
    - Add ability to pass multiple ParameterAnnotations
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    af851b3 View commit details
    Browse the repository at this point in the history
  97. Configuration menu
    Copy the full SHA
    300adcf View commit details
    Browse the repository at this point in the history
  98. Configuration menu
    Copy the full SHA
    e818f13 View commit details
    Browse the repository at this point in the history
  99. Split Arg into ShortName and Name

    - Allow for multiple parameter annotations
    - Rework the code of main to reflect changes and simplify treatment
    - Change output of help and usage to accomodate for multiple names
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    07426c4 View commit details
    Browse the repository at this point in the history
  100. Configuration menu
    Copy the full SHA
    cf0c98c View commit details
    Browse the repository at this point in the history
  101. Fix issue with explicit type for parameters

    - Before this fix, trying to remove the [Int] from the option resulted in: cannot infer type; expected type <?> is not fully defined
      To avoid this, we simply wrap the pre-typed arguments in TypedSplices
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    99f6ba3 View commit details
    Browse the repository at this point in the history
  102. Configuration menu
    Copy the full SHA
    2be6820 View commit details
    Browse the repository at this point in the history
  103. Configuration menu
    Copy the full SHA
    c681a6f View commit details
    Browse the repository at this point in the history
  104. Configuration menu
    Copy the full SHA
    5b44edf View commit details
    Browse the repository at this point in the history
  105. Configuration menu
    Copy the full SHA
    6f16275 View commit details
    Browse the repository at this point in the history
  106. Configuration menu
    Copy the full SHA
    86c6bed View commit details
    Browse the repository at this point in the history
  107. Reformat switch cases

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    fc1fba6 View commit details
    Browse the repository at this point in the history
  108. Configuration menu
    Copy the full SHA
    f1bc063 View commit details
    Browse the repository at this point in the history
  109. Avoid vars in code

    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    61744dd View commit details
    Browse the repository at this point in the history
  110. Configuration menu
    Copy the full SHA
    06514c4 View commit details
    Browse the repository at this point in the history
  111. Configuration menu
    Copy the full SHA
    5599dd5 View commit details
    Browse the repository at this point in the history
  112. Configuration menu
    Copy the full SHA
    823f320 View commit details
    Browse the repository at this point in the history
  113. Configuration menu
    Copy the full SHA
    a8da6b8 View commit details
    Browse the repository at this point in the history
  114. Configuration menu
    Copy the full SHA
    36988bb View commit details
    Browse the repository at this point in the history
  115. Configuration menu
    Copy the full SHA
    ddbb6d0 View commit details
    Browse the repository at this point in the history
  116. Pass ParameterInfos in command instead of getters

    - Pass ParameterInfos for parameters in the command method instead of the getter functions.
      This way, we know about all of them beforehand, and parsing can be done more efficiently.
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    a57ff52 View commit details
    Browse the repository at this point in the history
  117. Configuration menu
    Copy the full SHA
    c77f5d3 View commit details
    Browse the repository at this point in the history
  118. Rework of main.Name and main.ShortName

    - Merge Name and ShortName into Alias
    - Make Alias take a variable number of arguments
    - Distinguish between long and short names by string length
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    5558948 View commit details
    Browse the repository at this point in the history
  119. Configuration menu
    Copy the full SHA
    4e99de0 View commit details
    Browse the repository at this point in the history
  120. Add -h to display help

    - --help and -h display usage and help
    - if an argument or an alias is the same as either help or h, disable help printing for that argument
    timotheeandres committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    b359465 View commit details
    Browse the repository at this point in the history
  121. Configuration menu
    Copy the full SHA
    4ce8911 View commit details
    Browse the repository at this point in the history