Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-744

Allow groovy script extensions to be left off when running from command line

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.0-beta-9
    • 1.0-beta-10
    • None
    • All

    Description

      rather than typing (the repetitive):

      jez$ groovy Foo.groovy

      It would be nice to follow the convention of the 'java' executable, allowing a command line more like:

      jez$ groovy Foo

      This assumes that groovy can "hunt" for the correct script file, given a list of known filename extensions

      I propose that it will attempt to look in this order:
      1. actual supplied name
      2. name.groovy
      3. name.gvy
      4. name.gy
      5. name.gsh
      6. FileNotFoundException

      The actual values here are arbitrary, but the mechanism is sound even if people end up discussing what they'd like as a standard extension for groovy scripts.
      ['gvy' seems like a reasonable 3 letter version, using the major consonants]
      ['gy' follows the perl convention of first and last letter]
      ['gsh' follows the shell script convention of <type-of-shell>sh]
      ['g' is missed out due to the clash with antlr .g files, which are more likely than most to be in the same directory]

      Attachments

        Activity

          People

            jez Jeremy Rayner
            jez Jeremy Rayner
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: