Packages: [Bash] Flags emphasis inconsistent for "merged" flag `-o`

Created on 4 Mar 2020  路  4Comments  路  Source: sublimehq/Packages

  • Sublime Version: Sublime Text Build 3211
  • OS Version: Ubuntu 16.04.6 LTS
# Minimum code snippet to demonstrate the issue
set -Eeuo pipefail

Flag emphasis is inconsistent for some reason when the -o flag is "glued" to others.
image

Bug or feature?

(_I don't remember the term for writing the flags like that; feel free to educate/edit me_)

Most helpful comment

All 4 comments

@deathaxe That's the documentation for test. This ticket is special behavior for set, as generated from

https://github.com/sublimehq/Packages/blob/759d6eed9b4beed87e602a23303a121c3a6c2fb3/ShellScript/commands-builtin-shell-bash.yml#L114-L119

In the Builtin docs, -o/+o looks different from the other options, but it's unclear to me whether this means that it's ineligible for use as a "compacted" option.

set

set [--abefhkmnptuvxBCEHPT] [-o option-name] [argument 鈥
set [+abefhkmnptuvxBCEHPT] [+o option-name] [argument 鈥

Side notes:

  • Is there a typo in the documentation usage? [--a鈥 or [-a鈥?)
  • Some browsers respect Adobe's hash arguments when loading PDFs. The most useful one is direct-linking pages. Try https://www.gnu.org/software/bash/manual/bash.pdf#page=52. (Sorry I don't remember where I found this or any of the other shortcuts.)

The -o is special in not being a switch only, but being followed by an option name. While set -Eeuo pipefail is valid, set -Eeou pipefail wouldn't be. The algorithm to generate the syntax would need to be tweaked to allow short-options at the end of short-options-compact only (if merged).

Maybe match: (?:\s+|^)((\-|\+)(?:[o]|[abefhkmnptuvxBCEHPT]+o?))(?=\s|;|$||))`


About [--a...] : I guess it denotes the -- token in an unlucky way.

See usage output: set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]


About PDFs: DuckDuckGo just pushed me there. The Windows snipping tool just was the easiest way here. Just was to lazy to think about it more carefully ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

idleberg picture idleberg  路  4Comments

wbond picture wbond  路  3Comments

jcberquist picture jcberquist  路  4Comments

caub picture caub  路  3Comments

mouse07410 picture mouse07410  路  3Comments