File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,17 @@ pub struct CallArgs {
88impl CallArgs {
99 #[ allow( clippy:: single_match) ]
1010 pub async fn validate ( & self ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
11+ match & self . command {
12+ Command :: Render ( args) => {
13+ if args. helpers && args. shell_trust != ShellTrust :: Ultimate {
14+ return Err ( Box :: new ( crate :: error:: NoShellTrust :: new (
15+ "need ultimate shell trust for helper functions" ,
16+ ) ) ) ;
17+ }
18+ }
19+ _ => { }
20+ }
21+
1122 match self . privileges {
1223 Privilege :: Normal => match & self . command {
1324 Command :: Render ( args) => {
@@ -61,6 +72,7 @@ pub struct RenderArguments {
6172 pub backend : Backend ,
6273}
6374
75+ #[ derive( Debug , Eq , PartialEq ) ]
6476pub enum ShellTrust {
6577 None ,
6678 Prompt ,
@@ -89,7 +101,7 @@ impl ClapArgumentLoader {
89101 let command = clap:: App :: new ( "complate" )
90102 . version ( env ! ( "CARGO_PKG_VERSION" ) )
91103 . about ( "A rusty text templating application for CLIs." )
92- . author ( "Weber, Alexander <aw@voidpointergroup.com>" )
104+ . author ( "replicadse <aw@voidpointergroup.com>" )
93105 . arg ( clap:: Arg :: with_name ( "experimental" )
94106 . short ( "e" )
95107 . long ( "experimental" )
You can’t perform that action at this time.
0 commit comments