Skip to main content

just_core_cli 0.1.0 copy "just_core_cli: ^0.1.0" to clipboard
just_core_cli: ^0.1.0 copied to clipboard

The core of `just` (also `ju`), the Just ecosystem's command-line tool: projects, plugins and hooks, version sets, safe pubspec edits, transactions and downloads.

example/just_core_cli_example.dart

// A plugin: a package that adds `just hello` to the tool.
//
// In the package: this as bin/just_plugin.dart, and a just_plugin.json
// beside its pubspec:
//
//     {"schema": 1, "commands": [{"name": "hello", "summary": "Say hello."}]}

import 'dart:io';

import 'package:just_core_cli/just_core_cli.dart';

final class HelloCommand extends JustCommand {
  HelloCommand() {
    argParser.addOption('name', defaultsTo: 'world');
  }

  @override
  String get name => 'hello';

  @override
  String get description => 'Say hello.';

  @override
  Future<int> run() async {
    final who = argResults!.option('name');
    output
      ..result = {'greeted': who}
      ..line('Hello, $who!');
    return 0;
  }
}

Future<void> main(List<String> args) async {
  exitCode = await runJustPlugin(args, [HelloCommand()]);
}
1
likes
0
points
241
downloads

Publisher

verified publisherjustunknown.com

Weekly Downloads

The core of `just` (also `ju`), the Just ecosystem's command-line tool: projects, plugins and hooks, version sets, safe pubspec edits, transactions and downloads.

Repository (GitHub)
View/report issues

Topics

#cli #gamedev #game-engine #flutter

License

unknown (license)

Dependencies

args, just_deflate

More

Packages that depend on just_core_cli