private static CommandLineArgumentsDefinition PassThroughOrTryGetAmbientDefinition(CommandLineArgumentsDefinition def)
{
if(def != null)
{
return def;
}
else if(ArgHook.HookContext.Current != null && ArgHook.HookContext.Current.Definition != null)
{
return ArgHook.HookContext.Current.Definition;
}
else
{
throw new NullReferenceException("There is no ambient CommandLineArgumentsDefinition argument and you did not pass one in explicitly");
}
}