aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/git-sugpatch.rs
diff options
context:
space:
mode:
authorTeddy Wing2020-08-02 09:17:59 +0200
committerTeddy Wing2020-08-02 09:17:59 +0200
commitb5f9bcca207ddb312adcf8e63ac7a430b6f0902f (patch)
tree59e867fb638ac92eb9d4df4ec7dc3fd4a8a59114 /src/bin/git-sugpatch.rs
parented26c6671ed9e66543601111f64d02281a78e55f (diff)
downloadgit-suggestion-b5f9bcca207ddb312adcf8e63ac7a430b6f0902f.tar.bz2
git-sugpatch: Print usage with no suggestion argumenet
Add `Options` to `Config` to allow us to get a usage string from a `Config` instance, which is where we create `Options`. Needed to remove the `Debug` derive on `Config` in order to add the field as `Options` doesn't implement `Debug`.
Diffstat (limited to 'src/bin/git-sugpatch.rs')
-rw-r--r--src/bin/git-sugpatch.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bin/git-sugpatch.rs b/src/bin/git-sugpatch.rs
index 9b2769a..c8fc0a8 100644
--- a/src/bin/git-sugpatch.rs
+++ b/src/bin/git-sugpatch.rs
@@ -20,6 +20,11 @@ fn main() {
};
if config.suggestions.is_empty() {
+ print!(
+ "{}",
+ config.usage("usage: git sugpatch [options] <suggestion>..."),
+ );
+
process::exit(exitcode::USAGE);
}