Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guzba/bossy
A simpler way to work with command line arguments.
https://github.com/guzba/bossy
nim
Last synced: 10 days ago
JSON representation
A simpler way to work with command line arguments.
- Host: GitHub
- URL: https://github.com/guzba/bossy
- Owner: guzba
- License: mit
- Created: 2022-12-29T02:59:48.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-28T18:41:00.000Z (over 1 year ago)
- Last Synced: 2024-11-28T07:24:11.702Z (2 months ago)
- Topics: nim
- Language: Nim
- Homepage:
- Size: 53.7 KB
- Stars: 21
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bossy
`nimble install bossy`
![Github Actions](https://github.com/guzba/bossy/workflows/Github%20Actions/badge.svg)
[API reference](https://guzba.github.io/bossy/)
Bossy is a simple repo that makes working with command line arguments a little easier.
All Bossy does is parse the command line arguments using [std/parseopt](https://nim-lang.org/docs/parseopt.html) and give you a simpler interface to work with.
Bossy is great for supporting command line parameters without any magic.
If you want a powerful library for building command line interfaces, Bossy currently isn't that. There are other options on [Nimble](https://nimble.directory/).
## Example
```nim
import bossy## Get the command line arguments, parsed by Bossy
let args = getCommandLineArgs()## Check if an argument is present
echo "flag" in args## Get the value for an argument
echo args["port"]## Get the value for an argument, or use a default value
echo args.getOrDefault("port", "8080")
```