diff options
author | axel <axel@liljencrantz.se> | 2006-03-18 11:04:59 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-03-18 11:04:59 +1000 |
commit | 80b4055eab16e5b96015f128367d980f9fee4a1f (patch) | |
tree | 78543381c4579987a114cf38caa16f19bdcea8a9 /main.c | |
parent | 94b7c8d5e6a758d35f6a198babb0e8a4afb80dcb (diff) |
Add support for the -n switch to skip execution of any commands
darcs-hash:20060318010459-ac50b-9d9e5c489e0e4df2159d8c1d0ff952d42e2a2a82.gz
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -139,6 +139,10 @@ int main( int argc, char **argv ) } , { + "no-execute", no_argument, 0, 'n' + } + , + { "profile", required_argument, 0, 'p' } , @@ -160,14 +164,14 @@ int main( int argc, char **argv ) int opt = getopt_long( argc, argv, - "hilvc:p:d:", + "hilnvc:p:d:", long_options, &opt_index ); #else int opt = getopt( argc, argv, - "hilvc:p:d:" ); + "hilnvc:p:d:" ); #endif if( opt == -1 ) break; @@ -210,6 +214,10 @@ int main( int argc, char **argv ) is_login=1; break; + case 'n': + no_exec=1; + break; + case 'p': profile = optarg; break; @@ -236,6 +244,15 @@ int main( int argc, char **argv ) is_interactive_session &= isatty(STDIN_FILENO); is_interactive_session |= force_interactive; + /* + No-exec is prohibited when in interactive mode + */ + if( is_interactive_session && no_exec) + { + debug( 1, _(L"Can not use the no-execute mode when running an interactive session") ); + no_exec = 0; + } + common_init(); halloc_util_init(); |