Closed mezoni closed 9 years ago
Example for skeleton for command line program
import "package:args_helper/args_helper.dart"; import "package:yaml/yaml.dart"; void main(List arguments) { var config = loadYaml(_config); new ArgsHelper<Program>().run(arguments, config); } class Program { void batchCommand() { // batch(); } void checkCommand() { // check(); } void helpCommand() { print("Teachers should upload completed templates with tests to GitHub"); print("Repo url with form github.com/username/targets-project"); print("can be downloaded with targets get as username/project"); } void getCommand(String assignment) { // get(); } void initCommand(String name) { // init(); } void setupCommand() { // setup(); } void submitCommand() { // submit(); } } var _config = ''' name: targets description: Targets is an assignment manager and autograder for Dart programs commands: batch: description: Grades multiple submissions downloaded from server check: description: Runs tests on assignment get: description: Downloads assignment with name from GitHub rest: allowMultiple: false name: assignment required: true help: description: Help instructions init: description: Downloads template from GitHub rest: allowMultiple: false name: assignment required: false setup: description: Sets up targets for user submit: description: Submits assignment to server ''';
Fixed in 0.7.4, using args rather than args_helper.
Example for skeleton for command line program