GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [core] Migrate CLI to using GNU-style long options · Issue #3424 · pmd/pmd

[core] Migrate CLI to using GNU-style long options #3424

New issue
Copy link
New issue
Copy link
Closed
#3600
Closed
[core] Migrate CLI to using GNU-style long options#3424
#3600
Copy link
Assignees
oowekyala
Labels
an:enhancementAn improvement on existing features / rulesin:cliAffects the PMD Command Line Interface
Milestone
6.41.0

Description

@oowekyala
oowekyala
opened on Jul 29, 2021
Issue body actions

Is your feature request related to a problem? Please describe.
Currently our CLI uses ugly BSD-style options (long options with a single dash). Using a double dash for long options is more usual in modern programs (this is "GNU style"). Also our names are inconsistent,

  • eg -failOnViolation also has the variant --failOnViolation as synonym, but it's the only option that does
  • eg we use inconsistent word splitting conventions throughout, eg failOnViolation is camel case, -norulesetcompatibility is "clump-together case" as far as I'm concerned, while -no-cache is in the more usual style for long CLI options

Describe the solution you'd like

  • Add long variants for all our CLI options that
    • are GNU style (--)
    • use a consistent casing convention, eg --fail-on-violation, --no-ruleset-compatibility
  • Output a deprecation warning when the old variants are used.
  • Remove the old variants in PMD 7

Additional thoughts:

  • -version should NOT be renamed to --version. As per the gnu standards, the --version option should instead print the version of PMD. I suggest renaming it to --use-version.
  • CPD uses GNU style options and mostly uses --this-style but --failOnViolation is camel case and could also be updated
  • I'm not sure if we should rename --filelist to --file-list. It feels like a single word now with a specialized meaning, but I'm not sure that's the case
Reacted by Andreas Dangel

Activity

  1. oowekyala
    added
    an:enhancementAn improvement on existing features / rules
    in:cliAffects the PMD Command Line Interface
    on Jul 29, 2021
  2. oowekyala
    added this to the 6.38.0 milestone on Jul 29, 2021
  3. oowekyala
    self-assigned this
    on Jul 29, 2021
  4. adangel commented on Jul 29, 2021

    @adangel
    adangel
    on Jul 29, 2021
    Member
    More actions

    Regarding PMD 7 changes, also take a look at our old ideas at https://github.com/pmd/pmd/wiki/PMD-7.0.0-API#cli-api
    Especially we should have a look at JEP 293: Guidelines for JDK Command-Line Tool Options.

  5. adangel
    modified the milestones: 6.38.0, 6.39.0 on Aug 22, 2021
  6. adangel
    modified the milestones: 6.39.0, 6.40.0 on Sep 21, 2021
  7. adangel
    modified the milestones: 6.40.0, 6.41.0 on Oct 26, 2021
  8. duanyang25
    added 2 commits that reference this issue on Nov 3, 2021

    Add long CLI options and 'version' options and keep old ones pmd#3424,…

    e844dad

    add additional unit tests regarding long options, successfully implem…

    e7d8b8a
  9. adangel
    linked a pull request that will close this issue[core] Implement GNU-style long options and '--version' #3600on Nov 8, 2021
  10. adangel
    added 2 commits that reference this issue on Nov 25, 2021

    [doc] Update release notes (#3600, #3424, #3425)

    6153d44

    Merge pull request #3600 from duanyang25:master

    d1a6fcc
  11. adangel
    closed this as completedin #3600on Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @oowekyala
    oowekyala

Labels

an:enhancementAn improvement on existing features / rulesin:cliAffects the PMD Command Line Interface

Type

No type

Projects

No projects

    Milestone

    • 6.41.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.