osscameroon / js-generator

Generates JavaScript from HTML
https://osscameroon.github.io/js-generator/
MIT License
19 stars 14 forks source link

CLI : Possible duplicate on querySelector option #209

Open FanJups opened 1 year ago

FanJups commented 1 year ago

Handling querySelector on CLI

Is it a duplicate about querySelector ?

The second option was added by this PR https://github.com/osscameroon/js-generator/pull/186/files#diff-ef06e990aa80081e064fefe743b1c38439c60f28a89016f4f67f076550e408af

https://github.com/osscameroon/js-generator/blob/main/jsgenerator-slim-cli/src/main/java/com/osscameroon/jsgenerator/cli/internal/CommandDefault.java#L53

https://github.com/osscameroon/js-generator/blob/main/README.cli.md

    @Option(
            names = {"-s", "--selector"},
            defaultValue = ":root > body",
            description = "Target element selector")
    private String targetElementSelector = ":root > body";

    @Option(
            names = {"-qs", "--query-selector"},
            defaultValue = "true",
            description = "What the browser renders depends on whether \"document.querySelector(':root > body')\" is added to the output." +
                    "     If added, the browser will render the output successfully, it is useful for debugging purpose,\n" +
                    "     to verify that the js output matches what the html input does.\n" +
                    "     If not, if the user tries to run the output as it is then the browser will not be able to render,it will show a blank page.\n" +
                    "     So, it depends on what the user wants to do with the output.\n" +
                    "     \"https://jsfiddle.net/\", \"https://codepen.io/pen/\" and Browser Console  help to give a quick feedback.\n")
    private boolean querySelectorAdded = true;