|
1 | 1 | Quickstart
|
2 | 2 | ==========
|
3 | 3 |
|
| 4 | +.. TIP:: |
| 5 | + If this is your first time using `cabal` you should check out the `Getting Started guide <getting-started.html>`__. |
| 6 | + |
4 | 7 | Lets assume we have created a project directory and already have a
|
5 | 8 | Haskell module or two.
|
6 | 9 |
|
@@ -33,38 +36,40 @@ them for us.
|
33 | 36 | Using "cabal init"
|
34 | 37 | ------------------
|
35 | 38 |
|
36 |
| -The ``cabal init`` command is interactive. It asks us a number of |
37 |
| -questions starting with the package name and version. |
| 39 | +The ``cabal init --interactive`` command is interactive. If we answer |
| 40 | +"no" to using the "sensible defaults" it asks a number of questions. |
38 | 41 |
|
39 | 42 | ::
|
40 | 43 |
|
41 |
| - $ cabal init |
42 |
| - Package name [default "proglet"]? |
43 |
| - Package version [default "0.1"]? |
| 44 | + $ cabal init --interactive |
| 45 | + Should I generate a simple project with sensible defaults? [default: y] n |
| 46 | + What does the package build: |
| 47 | + 1) Executable |
| 48 | + 2) Library |
| 49 | + 3) Library and Executable |
| 50 | + Your choice? |
44 | 51 | ...
|
45 | 52 |
|
46 |
| -It also asks questions about various other bits of package metadata. For |
47 |
| -a package that you never intend to distribute to others, these fields |
48 |
| -can be left blank. |
49 |
| - |
50 | 53 | One of the important questions is whether the package contains a library
|
51 |
| -or an executable. Libraries are collections of Haskell modules that can |
52 |
| -be re-used by other Haskell libraries and programs, while executables |
| 54 | +and/or an executable. Libraries are collections of Haskell modules that |
| 55 | +can be re-used by other Haskell libraries and programs, while executables |
53 | 56 | are standalone programs.
|
54 | 57 |
|
55 |
| -:: |
56 |
| - |
57 |
| - What does the package build: |
58 |
| - 1) Library |
59 |
| - 2) Executable |
60 |
| - Your choice? |
61 |
| - |
62 | 58 | For the moment these are the only choices. For more complex packages
|
63 | 59 | (e.g. a library and multiple executables or test suites) the ``.cabal``
|
64 | 60 | file can be edited afterwards.
|
65 | 61 |
|
66 |
| -Finally, ``cabal init`` creates the initial ``proglet.cabal`` and |
67 |
| -``Setup.hs`` files, and depending on your choice of license, a |
| 62 | +After you make your selection (executable; library; or: library |
| 63 | +and executable) cabal asks us a number of questions starting with |
| 64 | +which version of the cabal specification to use, our package's name |
| 65 | +(for example, "proglet"), and our package's version. |
| 66 | + |
| 67 | +It also asks questions about various other bits of package metadata. For |
| 68 | +a package that you never intend to distribute to others, these fields |
| 69 | +can be left blank. |
| 70 | + |
| 71 | +Finally, ``cabal init --interactive`` creates the initial ``proglet.cabal`` |
| 72 | +and ``Setup.hs`` files, and depending on your choice of license, a |
68 | 73 | ``LICENSE`` file as well.
|
69 | 74 |
|
70 | 75 | ::
|
|
0 commit comments