|
@@ -104,8 +104,46 @@ if ( scalar keys %args < 1 ) {
|
|
printHelp();
|
|
printHelp();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+###
|
|
|
|
+# TODO: This args processing is better and more predictable than it was, bit there is still
|
|
|
|
+# likely a lot of room for improvement...
|
|
|
|
+###
|
|
|
|
+
|
|
|
|
+sub parseArgs {
|
|
|
|
+
|
|
|
|
+ if ( defined $args{'view'} && scalar keys %args > 1 ) {
|
|
|
|
+ print "Can't pass other args with --view\n";
|
|
|
|
+ exit 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ( defined $args{'dump-config'} && scalar keys %args > 1 ) {
|
|
|
|
+ print "Can't pass other args with --dump-config\n";
|
|
|
|
+ exit 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ( defined $args{'reset-from-master'} && scalar keys %args > 1 ) {
|
|
|
|
+ print "Can't pass other args with --reset-from-master\n";
|
|
|
|
+ exit 1;
|
|
|
|
+ }
|
|
|
|
|
|
-# This functionality is mainly here to test building out Git.pm, and doesn't really offer anything that regular git doesn't
|
|
|
|
|
|
+ if ( defined $args{'push-all'} ) {
|
|
|
|
+ foreach my $arg ( keys %args ) {
|
|
|
|
+ if ( $arg eq "interactive" || $arg eq "commit-msg" || $arg eq "push-all" ) {
|
|
|
|
+ next;
|
|
|
|
+ } else {
|
|
|
|
+ print "Can only pass --interactive and --commit-msg with --push-all\n";
|
|
|
|
+ exit 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+parseArgs();
|
|
|
|
+
|
|
|
|
+# TODO: This sub could be more concise with a sub to print array refs
|
|
if ( defined $args{'view'} ) {
|
|
if ( defined $args{'view'} ) {
|
|
my ( $untrackedRef, $modifiedRef, $addedRef, $deletedRef ) = returnState($logger);
|
|
my ( $untrackedRef, $modifiedRef, $addedRef, $deletedRef ) = returnState($logger);
|
|
my $refs = shellex("$gitCmd show-ref",$logger);
|
|
my $refs = shellex("$gitCmd show-ref",$logger);
|
|
@@ -155,11 +193,6 @@ if ( defined $args{'view'} ) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-###
|
|
|
|
-# TODO: This args processing is dangerous and incomplete, need to write an args processor function
|
|
|
|
-###
|
|
|
|
-
|
|
|
|
-# This functionality is mainly here to test building out Git.pm, and doesn't really offer anything that regular git doesn't
|
|
|
|
if ( defined $args{'push-all'} ) {
|
|
if ( defined $args{'push-all'} ) {
|
|
|
|
|
|
my ( $untrackedRef, $modifiedRef ) = returnState($logger);
|
|
my ( $untrackedRef, $modifiedRef ) = returnState($logger);
|