FIND YOUR NEXT FEW LINES

Results for “option”

Small, practical examples. Search by task or narrow things down below.

95 snippets foundClear filters
HTMLForm behavior

Make an unavailable select option unselectable

HTML: A disabled option remains visible but cannot be selected through normal keyboard navigation.

HTML✓ Tested
HTMLText semantics

Offer an optional break inside a long label

HTML: Wbr supplies a potential line-break opportunity without inserting a visible hyphen.

HTML✓ Tested
Bash ScriptsFunctions & arguments

Parse a short option with getopts

Read a named option and handle invalid flags explicitly.

getopts✓ Tested
Bash ScriptsArguments & decisions

Parse a small set of long options

Bash Scripts: Use a loop and case statement to consume a value-bearing long option.

Bash Scripts✓ Tested
PythonFunctions & error handling

Parse a typed command-line option

Python: Use argparse to validate and convert an integer option.

Python✓ Tested
HTMLGetting Started

Provide a list of selectable options

HTML: Learn how to provide a list of selectable options in a complete browser example.

HTML✓ Tested
Docker / ComposeCompose applications

Put an optional service behind a profile

Keep a utility service separate from a normal Compose startup.

Compose✓ Tested
TypeScriptSafe data handling

Read a nested optional value

Avoid dereferencing a missing nested object.

optional chaining✓ Tested
Bash ScriptsArray operations

Read an optional associative-array entry

Bash Scripts: Use a fallback expansion when a map key may not be present under nounset.

Bash Scripts✓ Tested
PythonMappings & sets

Read an optional dictionary key

Python: Use get with a fallback while leaving the dictionary unchanged.

Python✓ Tested
C#JSON & binary formats

Read an optional JSON property safely

C#: Use TryGetProperty instead of throwing when an optional property is absent.

C#✓ Tested
AngularTemplates & bindings

Read an optional nested value

Read an optional nested value with a standalone Angular component and explicit browser behavior.

Angular✓ Tested