Skip to content

Latest commit

 

History

History
110 lines (84 loc) · 8.47 KB

examples.md

File metadata and controls

110 lines (84 loc) · 8.47 KB
order icon
85
code-review

Examples

The examples folder in the GitHub repository contains many detailed and documented example configuration files, with their output.

!button variant="primary" icon="code-review" text="View Examples on GitHub"

All examples are listed below for convenience.

Basic use

Basic features

Advanced configuration features

  • catch-all - a command that can receive an arbitrary number of arguments
  • catch-all-advanced - another example for the catch_all option
  • catch-all-stdin - combining catch_all with stdin to read multiple files
  • extensible - letting your script's users extend the script
  • extensible-delegate - extending your script by delegating commands to an external executable
  • whitelist - arguments and flags with a predefined allowed list of values
  • repeatable-arg - allowing arguments to be provided multiple times
  • repeatable-flag - allowing flags to be provided multiple times
  • reusable-flags - reuse flag definition for multiple commands
  • conflicts - defining mutually exclusive flags
  • command-private - hiding commands from the command list
  • stdin - reading input from stdin
  • filters - preventing commands from running unless custom conditions are met
  • commands-expose - showing sub-commands in the parent's help
  • key-value-pairs - parsing key=value arguments and flags

Customization

Bashly library features

  • config - using the config library for easy access to INI files
  • ini - using the ini library for direct, low level access to INI files
  • yaml - using the YAML reading functions
  • colors - using the color print feature
  • completions - adding bash completion functionality
  • validations - adding argument validation functions
  • hooks - adding before/after hooks

Real-world-like examples

  • docker-like - a sample script with deep commands (like docker container run)
  • git-like - a sample script with sub-commands similar to git

Documentation generation

Other examples

  • settings - using the settings.yml file to adjust bashly's behavior
  • help-command - adding a help command to your script

Real world examples

These tools were developed using bashly. You can review their code to learn more about using bashly.

  • Alf - a generator for bash aliases and sub-aliases
  • git-changelog - a change log generator
  • Respec - a convenience wrapper for ruby's rspec
  • Rush - a Personal Package Manager
  • slack-emoji-toolkit - liberate your custom Slack emojis
  • orcli - OpenRefine command line interface