https://github.com/pyrestudios/bosun
Bosun is a library for building organized command line applications in Dart.
https://github.com/pyrestudios/bosun
cli dart hacktoberfest
Last synced: about 1 year ago
JSON representation
Bosun is a library for building organized command line applications in Dart.
- Host: GitHub
- URL: https://github.com/pyrestudios/bosun
- Owner: PyreStudios
- License: bsd-3-clause
- Created: 2021-12-15T20:29:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-08T23:38:50.000Z (about 4 years ago)
- Last Synced: 2024-05-01T11:28:33.596Z (about 2 years ago)
- Topics: cli, dart, hacktoberfest
- Language: Dart
- Homepage:
- Size: 45.9 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Bosun
## A library for parsing CLI input and structuring CLI commands
[](https://img.shields.io/pub/v/bosun)
[](https://codecov.io/gh/PyreStudios/bosun)
[](https://img.shields.io/pub/points/bosun)
[](https://img.shields.io/pub/likes/bosun)
## Features
- Structure CLI commands in a nice, uniform fashion.
- Parse args and flag information from a command tree.
- Auto generate meaningful output when nonsensical commands are ran.
- [EVENTUALLY] meaningful feature suggestions from **you**!
## Getting started
Add Bosun to your dependencies. See example (or usage below) for more information. Additional information coming soon.
## Usage
Bosun is simple to use! You'll leverage Bosun's Command class to structure your own commands. Additionally, you'll new up **one** BosunCommand and pass arguments to it. This is usually done directly in your main method, but doesnt have to be.
```dart
import 'package:bosun/bosun.dart';
class AppCmd extends Command {
AppCmd() : super(command: 'app', description: 'run as an app shell');
@override
void run(List args, Map flags) {
print("in the app command callback");
}
}
class RunCmd extends Command {
RunCmd()
: super(
command: 'run',
description: 'Run a command in a shell',
subcommands: [AppCmd()]);
@override
void run(List args, Map flags) {
print("in the run command callback");
}
}
void main(List args) {
execute(BosunCommand('donker', subcommands: [RunCmd()]), args);
}
```