feat(tvix/cli): add --no-warnings argument
This will prevent tvix from printing any warnings. As a followup, we can also thread this parameter through into the evaluator itself, to prevent warnings from being constructed in first place. Change-Id: I15381396f86573484bdd1a73d09034a665638e35 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8646 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
		
							parent
							
								
									c7e7f6d682
								
							
						
					
					
						commit
						93fa47f2ae
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -43,6 +43,10 @@ struct Args {
 | 
			
		|||
    #[clap(long)]
 | 
			
		||||
    compile_only: bool,
 | 
			
		||||
 | 
			
		||||
    /// Don't print warnings.
 | 
			
		||||
    #[clap(long)]
 | 
			
		||||
    no_warnings: bool,
 | 
			
		||||
 | 
			
		||||
    /// A colon-separated list of directories to use to resolve `<...>`-style paths
 | 
			
		||||
    #[clap(long, short = 'I', env = "NIX_PATH")]
 | 
			
		||||
    nix_search_path: Option<String>,
 | 
			
		||||
| 
						 | 
				
			
			@ -126,9 +130,11 @@ fn interpret(code: &str, path: Option<PathBuf>, args: &Args, explain: bool) -> b
 | 
			
		|||
        error.fancy_format_stderr(&source_map);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if !args.no_warnings {
 | 
			
		||||
        for warning in &result.warnings {
 | 
			
		||||
            warning.fancy_format_stderr(&source_map);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if let Some(value) = result.value.as_ref() {
 | 
			
		||||
        if explain {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue