@@ -54,34 +54,7 @@ struct Opt {
5454
5555 /// Subcommand
5656 #[ structopt( subcommand) ]
57- cmd : Command ,
58- }
59-
60- #[ derive( Debug , StructOpt ) ]
61- enum Command {
62- /// Config commands
63- #[ structopt( name = "config" ) ]
64- Config {
65- /// Config sub-command
66- #[ structopt( subcommand) ]
67- cmd : Option < subcmds:: config:: Command > ,
68- } ,
69- /*
70- /// Key operations
71- #[structopt(name = "key")]
72- Key {
73- /// Key subcommand
74- #[structopt(subcommand)]
75- cmd: KeyCommand,
76- },
77- */
78- /// Provenance log operations
79- #[ structopt( name = "plog" ) ]
80- Plog {
81- /// Provenance log subcommand
82- #[ structopt( subcommand) ]
83- cmd : Box < subcmds:: plog:: Command > ,
84- } ,
57+ cmd : Option < Command > ,
8558}
8659
8760/*
@@ -114,10 +87,13 @@ async fn main() -> Result<(), Error> {
11487 let config = Config :: from_path ( opt. config , opt. keyfile , opt. sshagent , opt. sshagentenv ) ?;
11588
11689 let ret = match opt. cmd {
117- // process a config command
118- Command :: Config { cmd } => subcmds:: config:: go ( cmd, & config) . await ,
119- // process a plog command
120- Command :: Plog { cmd } => subcmds:: plog:: go ( * cmd, & config) . await ,
90+ Some ( cmd) => match cmd {
91+ // process a config command
92+ Command :: Config { cmd } => subcmds:: config:: go ( cmd, & config) . await ,
93+ // process a plog command
94+ Command :: Plog { cmd } => subcmds:: plog:: go ( * cmd, & config) . await ,
95+ } ,
96+ None => repl:: ReplHelper :: run ( ) . await ,
12197 } ;
12298
12399 if let Err ( ref e) = ret {
0 commit comments