Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03933438 authored by Thiébaud Weksteen's avatar Thiébaud Weksteen
Browse files

lint_fix: fix CLI arguments use

Commit df4cd065 updated how command line arguments are parsed. However,
sys.argv[0] should be ignored (as this is the name of the program).
Remove the argument, so the default value (sys.argv[1:]) is used.

Also, use the embedded_launcher so that the help renders
as:
    usage: lint_fix [-h]
instead of:
    usage: usage: __soong_entrypoint_redirector__.py [-h]

Test: lint_fix --print --no-fix --check AnnotatedAidlCounter \
       --lint-module AndroidUtilsLintChecker services.autofill
Change-Id: I00e3e3b70c9715e363d3448ae84bf9ff161f2306
parent 03e470ea
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,11 @@ python_binary_host {
    name: "lint_fix",
    main: "soong_lint_fix.py",
    srcs: ["soong_lint_fix.py"],
    version: {
        py3: {
            embedded_launcher: true,
        },
    },
}

python_library_host {
+1 −1
Original line number Diff line number Diff line
@@ -213,5 +213,5 @@ def _setup_parser():

if __name__ == "__main__":
    opts = SoongLintFixOptions()
    opts.parse_args(sys.argv)
    opts.parse_args()
    SoongLintFix(opts).run()