# The Shape of an App

The Shape of an App: Options and Flags: getopts and --help, Subcommands: app add, app list, Where an App Keeps Its Data.

Updated: November 10, 2026

1. [Options and Flags: getopts and --help](https://www.ask-codey.com/lessons/bash-options-with-getopts) (Journeyman): getopts reads a script's one-letter options in any order, flags and options with a value alike, and a real tool also answers --help with a help page and --version with its version number.
2. [Subcommands: app add, app list](https://www.ask-codey.com/lessons/bash-subcommands) (Freelancer): A tool that does several jobs gives each job a word of its own, a subcommand, as git and docker do: a case on the first argument picks the job, shift drops that word, and one function per subcommand does the work.
3. [Where an App Keeps Its Data](https://www.ask-codey.com/lessons/bash-app-data-and-config) (Journeyman): An app keeps its data in ~/.local/share and its settings in ~/.config, whatever folder you run it from, makes those folders and files itself on its first run, and loads its settings file with source.

Source: https://www.ask-codey.com/courses/bash-in-depth/topics/bash-the-shape-of-an-app
