mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 13:29:12 +00:00 
			
		
		
		
	Rename help_v2 to formatted_help
Also add comments to `help()` and `formatted_help()` to clarify usage.
This commit is contained in:
		
							parent
							
								
									23a066f71f
								
							
						
					
					
						commit
						605f12c2ae
					
				
					 3 changed files with 7 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -118,14 +118,14 @@ void Pass::post_execute(Pass::pre_post_exec_state_t state)
 | 
			
		|||
 | 
			
		||||
void Pass::help()
 | 
			
		||||
{
 | 
			
		||||
	if (!help_v2()) {
 | 
			
		||||
	if (!formatted_help()) {
 | 
			
		||||
		log("\n");
 | 
			
		||||
		log("No help message for command `%s'.\n", pass_name.c_str());
 | 
			
		||||
		log("\n");
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool Pass::help_v2()
 | 
			
		||||
bool Pass::formatted_help()
 | 
			
		||||
{
 | 
			
		||||
	return false;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -825,7 +825,7 @@ struct HelpPass : public Pass {
 | 
			
		|||
			auto experimental_flag = pass->experimental_flag;
 | 
			
		||||
 | 
			
		||||
			auto cmd_help = PrettyHelp(PrettyHelp::Mode::LISTING);
 | 
			
		||||
			auto has_pretty_help = pass->help_v2();
 | 
			
		||||
			auto has_pretty_help = pass->formatted_help();
 | 
			
		||||
 | 
			
		||||
			if (!has_pretty_help) {
 | 
			
		||||
				enum PassUsageState {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -59,8 +59,10 @@ struct Pass
 | 
			
		|||
	// Prefer overriding 'Pass::on_shutdown()' if possible
 | 
			
		||||
	virtual ~Pass();
 | 
			
		||||
 | 
			
		||||
	// Makes calls to log() to generate help message
 | 
			
		||||
	virtual void help();
 | 
			
		||||
	virtual bool help_v2();
 | 
			
		||||
	// Uses PrettyHelp::get_current() to produce a more portable formatted help message
 | 
			
		||||
	virtual bool formatted_help();
 | 
			
		||||
	virtual void clear_flags();
 | 
			
		||||
	virtual void execute(std::vector<std::string> args, RTLIL::Design *design) = 0;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -73,7 +73,7 @@ static bool is_triggered_check_cell(RTLIL::Cell * cell)
 | 
			
		|||
struct ChformalPass : public Pass {
 | 
			
		||||
	ChformalPass() : Pass("chformal", "change formal constraints of the design") {}
 | 
			
		||||
 | 
			
		||||
	bool help_v2() override {
 | 
			
		||||
	bool formatted_help() override {
 | 
			
		||||
		auto *help = PrettyHelp::get_current();
 | 
			
		||||
		help->set_group("formal");
 | 
			
		||||
		help->usage("chformal [types] [mode] [options] [selection]");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue