From: simonmar Date: Mon, 27 Jun 2005 08:53:03 +0000 (+0000) Subject: [project @ 2005-06-27 08:53:03 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~411 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ecf0f1c0d948629cf1ad9399a389b4d12711abfd;p=ghc-hetmet.git [project @ 2005-06-27 08:53:03 by simonmar] Rename :tags to :etags and :ctags. The problem was that :tags prevented the common abbreviation of :type, namely :t. Also, :etags and :ctags match the *nix commands of the same name, and this way makes it easier for them to take an optional filename argument (which they now do). --- diff --git a/ghc/compiler/ghci/InteractiveUI.hs b/ghc/compiler/ghci/InteractiveUI.hs index 76a80b5..eff766c 100644 --- a/ghc/compiler/ghci/InteractiveUI.hs +++ b/ghc/compiler/ghci/InteractiveUI.hs @@ -107,7 +107,8 @@ builtin_commands = [ ("check", keepGoing checkModule), ("set", keepGoing setCmd), ("show", keepGoing showCmd), - ("tags", keepGoing createTagsFileCmd), + ("etags", keepGoing createETagsFileCmd), + ("ctags", keepGoing createCTagsFileCmd), ("type", keepGoing typeOfExpr), ("kind", keepGoing kindOfType), ("unset", keepGoing unsetOptions), @@ -145,7 +146,8 @@ helpText = " :show modules show the currently loaded modules\n" ++ " :show bindings show the current bindings made at the prompt\n" ++ "\n" ++ - " :tags -e|-c create tags file for Vi (-c) or Emacs (-e)\n" ++ + " :ctags [] create tags file for Vi (default: \"tags\")\n" ++ + " :etags [] create tags file for Emacs (defauilt: \"TAGS\")\n" ++ " :type show the type of \n" ++ " :kind show the kind of \n" ++ " :undef undefine user-defined command :\n" ++ @@ -744,10 +746,13 @@ shellEscape str = io (system str >> return False) ----------------------------------------------------------------------------- -- create tags file for currently loaded modules. -createTagsFileCmd :: String -> GHCi () -createTagsFileCmd "-c" = ghciCreateTagsFile CTags "tags" -createTagsFileCmd "-e" = ghciCreateTagsFile ETags "TAGS" -createTagsFileCmd _ = throwDyn (CmdLineError "syntax: :tags -c|-e") +createETagsFileCmd, createCTagsFileCmd :: String -> GHCi () + +createCTagsFileCmd "" = ghciCreateTagsFile CTags "tags" +createCTagsFileCmd file = ghciCreateTagsFile CTags file + +createETagsFileCmd "" = ghciCreateTagsFile ETags "TAGS" +createETagsFileCmd file = ghciCreateTagsFile ETags file data TagsKind = ETags | CTags