30 lines
1.1 KiB
Dart
30 lines
1.1 KiB
Dart
import 'package:libac_dart/argparse/Args.dart';
|
|
import 'package:libac_dart/argparse/Builder.dart';
|
|
import 'package:libac_dart/argparse/CLIHelper.dart';
|
|
import 'package:libac_dart/argparse/types/Bool.dart';
|
|
import 'package:simplehelpertools/constants.dart';
|
|
|
|
String get CH_VERSION => HelperConsts.CH_VERSION;
|
|
|
|
Future<int> main(List<String> args) async {
|
|
print("Git Commit Helper\nVersion: ${CH_VERSION}\n\n");
|
|
|
|
Arguments defaults = ArgumentsBuilder.builder()
|
|
.withArgument(
|
|
BoolArgument(name: "help", description: "Print out this help page"))
|
|
.withArgument(BoolArgument(
|
|
name: "commit",
|
|
description: "Create a commit for the current working directory"))
|
|
.withArgument(BoolArgument(name: "sign", description: "Sign the commit"))
|
|
.withArgument(BoolArgument(
|
|
name: "force", description: "Ignore gitignore rules for commits"))
|
|
.build();
|
|
|
|
Arguments argx = await CLIHelper.parseArgs(args, Arguments());
|
|
if (argx.hasArg("help") || argx.count == 0) {
|
|
print(CLIHelper.makeArgCLIHelp(defaults));
|
|
return 0;
|
|
}
|
|
|
|
return 0;
|
|
}
|