Merge pull request #23 from ifupdown-ng/feature/multicall-manpage-xref
add manpage xref to applet help output
This commit is contained in:
		
						commit
						2c562b7be0
					
				
					 4 changed files with 7 additions and 0 deletions
				
			
		|  | @ -329,5 +329,6 @@ struct if_applet ifquery_applet = { | |||
| 	.desc = "query interface configuration", | ||||
| 	.main = ifquery_main, | ||||
| 	.usage = "ifquery [options] <interfaces>\n  ifquery [options] --list", | ||||
| 	.manpage = "8 ifquery", | ||||
| 	.groups = { &global_option_group, &match_option_group, &exec_option_group, &local_option_group }, | ||||
| }; | ||||
|  |  | |||
|  | @ -239,6 +239,7 @@ struct if_applet ifup_applet = { | |||
| 	.desc = "bring interfaces up", | ||||
| 	.main = ifupdown_main, | ||||
| 	.usage = "ifup [options] <interfaces>", | ||||
| 	.manpage = "8 ifup", | ||||
| 	.groups = { &global_option_group, &match_option_group, &exec_option_group, }, | ||||
| }; | ||||
| 
 | ||||
|  | @ -247,5 +248,6 @@ struct if_applet ifdown_applet = { | |||
| 	.desc = "take interfaces down", | ||||
| 	.main = ifupdown_main, | ||||
| 	.usage = "ifdown [options] <interfaces>", | ||||
| 	.manpage = "8 ifdown", | ||||
| 	.groups = { &global_option_group, &match_option_group, &exec_option_group, }, | ||||
| }; | ||||
|  |  | |||
|  | @ -62,6 +62,9 @@ generic_usage(const struct if_applet *applet, int result) | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	if (applet->manpage != NULL) | ||||
| 		fprintf(stderr, "\nFor more information: man %s\n", applet->manpage); | ||||
| 
 | ||||
| 	exit(result); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -43,6 +43,7 @@ struct if_applet { | |||
| 	const char *name; | ||||
| 	const char *desc; | ||||
| 	const char *usage; | ||||
| 	const char *manpage; | ||||
| 	int (*const main)(int argc, char *argv[]); | ||||
| 	const struct if_option_group *groups[16]; | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue