Add help message
This commit is contained in:
parent
1df6517d16
commit
63553a82a2
2 changed files with 30 additions and 8 deletions
30
dart/bin/ch.dart
Normal file
30
dart/bin/ch.dart
Normal file
|
@ -0,0 +1,30 @@
|
|||
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;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
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}");
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue