summaryrefslogtreecommitdiff
path: root/builtins/caller.def
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2005-12-07 14:08:12 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:57 +0000
commit95732b497d12c98613bb3c5db16b61f377501a59 (patch)
tree5e1cdf79eb0407e09dca4c0ec29e11442c7d1d15 /builtins/caller.def
parenteb87367179effbe5f430236db8259006d71438b7 (diff)
downloadbash-95732b497d12c98613bb3c5db16b61f377501a59.tar.gz
Imported from ../bash-3.1.tar.gz.
Diffstat (limited to 'builtins/caller.def')
-rw-r--r--builtins/caller.def9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtins/caller.def b/builtins/caller.def
index d372c588..5142cab9 100644
--- a/builtins/caller.def
+++ b/builtins/caller.def
@@ -55,6 +55,7 @@ $END
#include "../shell.h"
#include "common.h"
#include "builtext.h"
+#include "bashgetopt.h"
#ifdef LOADABLE_BUILTIN
# include "builtins.h"
@@ -88,6 +89,10 @@ caller_builtin (list)
if (bash_source_a == 0 || array_empty (bash_source_a))
return (EXECUTION_FAILURE);
+ if (no_options (list))
+ return (EX_USAGE);
+ list = loptend; /* skip over possible `--' */
+
/* If there is no argument list, then give short form: line filename. */
if (list == 0)
{
@@ -125,11 +130,11 @@ caller_builtin (list)
#ifdef LOADABLE_BUILTIN
static char *caller_doc[] = {
N_("Returns the context of the current subroutine call."),
- N_(""),
+ N_(" "),
N_("Without EXPR, returns returns \"$line $filename\". With EXPR,"),
N_("returns \"$line $subroutine $filename\"; this extra information"),
N_("can be used used to provide a stack trace."),
- N_(""),
+ N_(" "),
N_("The value of EXPR indicates how many call frames to go back before the"),
N_("current one; the top frame is frame 0."),
(char *)NULL