Permalink
Browse files

Add --with-doc/--with-file options

  • Loading branch information...
1 parent e7dc7e0 commit 1e477ef20aff9f28e5a43c188dd7c086d9f04f5d @tkf tkf committed with rejeep Feb 20, 2013
Showing with 13 additions and 3 deletions.
  1. +1 −1 ecukes
  2. +9 −0 ecukes.el
  3. +3 −2 templates/usage.tpl
View
2 ecukes
@@ -49,7 +49,7 @@ fi
if [ "$1" == "-h" -o "$1" == "--help" ] ; then
cat $ECUKES_HOME/templates/usage.tpl
elif [ "$1" == "--list-steps" ] ; then
- "$ECUKES_EMACS" --script "$ECUKES_EL" --eval "(ecukes-print-steps $2)"
+ "$ECUKES_EMACS" --script "$ECUKES_EL" -f ecukes-cli-print-steps "${@:2}"
elif [ "$1" == "--new" ] ; then
"$ECUKES_EMACS" --script "$ECUKES_NEW" --eval "(ecukes-new)"
elif [ "$1" == "--script" ] ; then
View
@@ -74,6 +74,15 @@ Include docstring when WITH-DOC is non-nil."
(princ "\n")))
ecukes-steps-definitions))
+(defun ecukes-cli-print-steps ()
+ (let ((has (lambda (flag)
+ (when (member flag command-line-args-left)
+ (setq command-line-args-left
+ (delete flag command-line-args-left))
+ t))))
+ (ecukes-print-steps (funcall has "--with-doc")
+ (funcall has "--with-file"))))
+
(provide 'ecukes)
;;; ecukes.el ends here
View
@@ -5,8 +5,9 @@ OPTIONS:
--script Run Ecukes as a script/batch job
--win Run Ecukes with full GUI window
--new Create new Ecukes setup for project
- --list-steps [DOC] Print all available steps defined for this project.
- Call it like `--list-steps t' to include step docstring.
+ --list-steps Print all available steps defined for this project.
+ --with-doc Include docstring when printing steps with --list-steps.
+ --with-file Include file name when printing steps with --list-steps.
--verbose Show `message' output
--dbg Run in debug mode (enable as much debug options in Emacs as possible)
--tags TAG_EXPRESSION Only execute the scenarios with tags matching TAG_EXPRESSION.

0 comments on commit 1e477ef

Please sign in to comment.