Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
c43fd9b2
Commit
c43fd9b2
authored
3 years ago
by
Patrick Augusto
Committed by
mergify-bot
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Amending the docs for cabal init extra args
parent
9a20faf9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/src/Distribution/Client/Setup.hs
+4
-2
4 additions, 2 deletions
cabal-install/src/Distribution/Client/Setup.hs
doc/getting-started.rst
+19
-17
19 additions, 17 deletions
doc/getting-started.rst
with
23 additions
and
19 deletions
cabal-install/src/Distribution/Client/Setup.hs
+
4
−
2
View file @
c43fd9b2
...
...
@@ -2031,10 +2031,12 @@ initCommand = CommandUI {
++
"Calling init with no arguments runs interactive mode, "
++
"which will try to guess as much as possible and prompt you for the rest.
\n
"
++
"Non-interactive mode can be invoked by the -n/--non-interactive flag, "
++
"which will let you specify the options via flags and will use the defaults for the rest.
\n
"
,
++
"which will let you specify the options via flags and will use the defaults for the rest.
\n
"
++
"It is also possible to call init with a single argument, which denotes the project's desired "
++
"root directory.
\n
"
,
commandNotes
=
Nothing
,
commandUsage
=
\
pname
->
"Usage: "
++
pname
++
" init [FLAGS]
\n
"
,
"Usage: "
++
pname
++
" init
[PROJECT ROOT]
[FLAGS]
\n
"
,
commandDefaultFlags
=
IT
.
defaultInitFlags
,
commandOptions
=
initOptions
}
...
...
This diff is collapsed.
Click to expand it.
doc/getting-started.rst
+
19
−
17
View file @
c43fd9b2
...
...
@@ -19,19 +19,16 @@ and how to add external dependencies.
Initializing the application
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Start by
creating a ``myfirstapp`` directory to hold the project files, these
instructions work in
unix shells and PowerShell (if you're on Windows).
Start by
initialising our ``myfirstapp`` project, these instructions work in
unix shells and PowerShell (if you're on Windows).
.. code-block:: console
$ mkdir myfirstapp
$ cd myfirstapp
$ cabal init myfirstapp -n
Once you have an empty directory we can initialize our package:
.. code-block:: console
$ cabal init -n
.. note:: ``myfirstapp`` stands for the directory (or path) where the project
will reside in, if ommited, ``cabal init`` will do its proceedings
in the directory it's called in.
.. note:: ``-n`` stands for ``--non-interactive``, which means that cabal will try to guess
how to set up the project for you and use the default settings, which will serve us
...
...
@@ -48,10 +45,11 @@ This will generate the following files:
$ tree
.
├── app
│ └── Main.hs
├── CHANGELOG.md
└── myfirstapp.cabal
└── myfirstapp
├── app
│ └── Main.hs
├── CHANGELOG.md
└── myfirstapp.cabal
``app/Main.hs`` is where your package's code lives.
...
...
@@ -63,11 +61,15 @@ little bit when we add an external dependency to our package.
Running the application
^^^^^^^^^^^^^^^^^^^^^^^
When we ran ``cabal init -n`` above, it generated a package with a single executable
named same as the package (in this case ``myfirstapp``) that prints ``"Hello, Haskell!"``
to the terminal. To run the executable enter the following command:
When we ran ``cabal init myfirstapp -n`` above, it generated a package with a single
executable named same as the package (in this case ``myfirstapp``) that prints
``"Hello, Haskell!"`` to the terminal. To run the executable enter the project's
directory and run it, by inputting the following commands:
.. code-block:: console
``cabal run myfirstapp``
cd myfirstapp
cabal run myfirstapp
You should see the following output in the terminal:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment