Skip to content

PyreStudios/bosun

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Bosun

A library for parsing CLI input and structuring CLI commands

pub version codecov points likes

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.

import 'package:bosun/bosun.dart';

class AppCmd extends Command {
  AppCmd() : super(command: 'app', description: 'run as an app shell');

  @override
  void run(List<String> args, Map<String, dynamic> 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<String> args, Map<String, dynamic> flags) {
    print("in the run command callback");
  }
}

void main(List<String> args) {
  execute(BosunCommand('donker', subcommands: [RunCmd()]), args);
}

About

Bosun is a library for building organized command line applications in Dart.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published