Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show help if without any subcommand #146

Merged
merged 1 commit into from
Oct 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use atty::Stream;
use base64::decode as base64_decode;
use chrono::{TimeZone, Utc};
use clap::{arg_enum, crate_authors, crate_version, App, Arg, ArgMatches, SubCommand};
use clap::{arg_enum, crate_authors, crate_version, App, AppSettings, Arg, ArgMatches, SubCommand};
use jsonwebtoken::errors::{ErrorKind, Result as JWTResult};
use jsonwebtoken::{
dangerous_insecure_decode, decode, encode, Algorithm, DecodingKey, EncodingKey, Header,
Expand Down Expand Up @@ -156,6 +156,7 @@ fn config_options<'a, 'b>() -> App<'a, 'b> {
.about("Encode and decode JWTs from the command line. RSA and ECDSA encryption currently only supports keys in DER format")
.version(crate_version!())
.author(crate_authors!())
.setting(AppSettings::ArgRequiredElseHelp)
.subcommand(
SubCommand::with_name("encode")
.about("Encode new JWTs")
Expand Down