aboutsummaryrefslogtreecommitdiffhomepage
path: root/builtin_commandline.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-05-26 21:24:02 +1000
committerGravatar axel <axel@liljencrantz.se>2006-05-26 21:24:02 +1000
commit17171c3277edaf893ba4fad0a71b76f46fcf7e07 (patch)
treeb968f549ffdf4e642f0c26446896fc268cc60bf5 /builtin_commandline.c
parent18a59291eda5636023eeeab16c0998e6c4e197dc (diff)
If a help page for a builtin is showed in response to an error, make sure it fits on screen, or only print the synopsis - this patch also contains a huge number of tweaks to where and when the help pages are printed
darcs-hash:20060526112402-ac50b-88993e45f411b2f1c45b3202c393c5328f1c7429.gz
Diffstat (limited to 'builtin_commandline.c')
-rw-r--r--builtin_commandline.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin_commandline.c b/builtin_commandline.c
index 500a27de..3d0f77e0 100644
--- a/builtin_commandline.c
+++ b/builtin_commandline.c
@@ -266,6 +266,10 @@ int builtin_commandline( wchar_t **argv )
}
,
{
+ L"help", no_argument, 0, 'h'
+ }
+ ,
+ {
0, 0, 0, 0
}
}
@@ -275,7 +279,7 @@ int builtin_commandline( wchar_t **argv )
int opt = wgetopt_long( argc,
argv,
- L"aijpctwfor",
+ L"aijpctwforh",
long_options,
&opt_index );
if( opt == -1 )
@@ -330,6 +334,10 @@ int builtin_commandline( wchar_t **argv )
tokenize=1;
break;
+ case 'h':
+ builtin_print_help( argv[0], sb_out );
+ return 0;
+
case L'?':
builtin_print_help( argv[0], sb_err );
return 1;