$ bash ./test.sh;
declare -- bitfields="101"
declare -a scopes=([0]="user-profile" [1]="user-email")
See! Marvelous!
Last active
February 12, 2026 18:54
-
-
Save serious-angel/663a4d45dafabb21565bd1493148af01 to your computer and use it in GitHub Desktop.
Multi-line comments example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env bash | |
| _Request() | |
| { | |
| declare bitfields="$1"; | |
| shift 1 || return 2; | |
| # Let's imagine proper CLI options parsing here for `--scopes`. | |
| shift 1 || return 2; | |
| declare scopesString="$1"; | |
| shift $# || return 2; | |
| declare scopes=(); | |
| readarray -td : -- scopes < <( printf '%s' "$scopesString"; ); | |
| declare -p bitfields scopes; | |
| } | |
| _Main() | |
| { | |
| _Request \ | |
| '1'` # Enable updates service | |
| `'0'` # Disable monitoring | |
| `'1'` # Enable status endpoint` \ | |
| --scopes ` | |
| # Public User profile data | |
| `'user-profile'` | |
| # Private User Email address access | |
| `':user-email'` | |
| # Other options | |
| ` "$@" \ | |
| || \ | |
| return $?; | |
| printf 'See! Marvelous!\n'; | |
| } | |
| _Main "$@"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment