Skip to content

Commit e4efac9

Browse files
authored
Show help if without any subcommand (#146)
1 parent 65afd8c commit e4efac9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use atty::Stream;
22
use base64::decode as base64_decode;
33
use chrono::{TimeZone, Utc};
4-
use clap::{arg_enum, crate_authors, crate_version, App, Arg, ArgMatches, SubCommand};
4+
use clap::{arg_enum, crate_authors, crate_version, App, AppSettings, Arg, ArgMatches, SubCommand};
55
use jsonwebtoken::errors::{ErrorKind, Result as JWTResult};
66
use jsonwebtoken::{
77
dangerous_insecure_decode, decode, encode, Algorithm, DecodingKey, EncodingKey, Header,
@@ -156,6 +156,7 @@ fn config_options<'a, 'b>() -> App<'a, 'b> {
156156
.about("Encode and decode JWTs from the command line. RSA and ECDSA encryption currently only supports keys in DER format")
157157
.version(crate_version!())
158158
.author(crate_authors!())
159+
.setting(AppSettings::ArgRequiredElseHelp)
159160
.subcommand(
160161
SubCommand::with_name("encode")
161162
.about("Encode new JWTs")

0 commit comments

Comments
 (0)