Comment by kmarc

Comment by kmarc 2 days ago

5 replies

I usually do this by hand. Good to see a tool for it :-)

Feature request, which I would love to have in all my automation scripts:

Replace short flags with the long switches. Short flags are great when typing in a terminal but I don't want to figure out 2 years from now what the

    obscurecommand -v -f -n
does, and I have to assume that it's NOT --version --file --dry-run, but --verbose, --force, and --dont-ask-before-deleting-everything

I try to use long options in my script, therefore (especially in a team, where not everyone is familiar with every single command)

notpushkin 2 days ago

It would be a great rule for shellcheck, by the way.

  Line 6:
    curl -fsSL "${url}"
         ^-- SC8537 (warning): use long options instead (`--fail`, `--silent`, `--show-error`, `--location`).
  • yjftsjthsd-h 2 days ago

    I would want it opt-in, because I use shellcheck on scripts that will be run on busybox or *BSD where there aren't long options

    • notpushkin 2 days ago

      Of course.

      • yjftsjthsd-h 2 days ago

        Oh, I didn't realize shellcheck already had optional checks (see `shellcheck --list-optional` for a list), so that was not obvious to me initially. Then yes, that'd be a good thing to have available.

jakub_g a day ago

When I saw "deminifier for shell commands" in title I had exactly the same in mind.