Skip to content

Extra argument for cabal init as starting dir - #7873

Merged
mergify[bot] merged 2 commits into
haskell:masterfrom
ptkato:cabal-init-start-dir
Dec 23, 2021
Merged

mergify[bot] merged 2 commits into
haskell:masterfrom
ptkato:cabal-init-start-dir

Conversation

@ptkato

@ptkato ptkato commented Dec 20, 2021 •

Copy link
Copy Markdown
Collaborator

Closes #7871. cabal init will now take the first value in extraArgs and treat it as the root directory for the new project; i.e.:

cabal init -n -- my-project

Please include the following checklist in your PR:

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Mikolaj

Mikolaj commented Dec 20, 2021

Copy link
Copy Markdown
Member

@konsumlamm: would that help you as a user? How does it compare to what stack has?

@konsumlamm

Copy link
Copy Markdown

Is there any reason we can't just have cabal init my-project instead of cabal init -- my-project? For reference, the syntax for stack is stack new my-project.

@ptkato

ptkato commented Dec 20, 2021

Copy link
Copy Markdown
Collaborator Author

Oh, you can type it like that, iirc -- exists only to avoid ambiguity in certain cases.

@konsumlamm

Copy link
Copy Markdown

Oh, you can type it like that, iirc -- exists only to avoid ambiguity in certain cases.

Ah, if that's the case, I'm happy with the implementation. Thanks for working on this so fast!

How does documenting new features usually work, will there be a separate PR for that?

@ptkato

ptkato commented Dec 20, 2021

Copy link
Copy Markdown
Collaborator Author

It's usually together with the feature PR, but I personally wait for it to be greenlit, so I don't document something that won't go forward.

@ptkato
ptkato force-pushed the cabal-init-start-dir branch from 2616fa5 to c8873d3 Compare December 20, 2021 23:24

@bacchanalia bacchanalia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a maintainer, but I took a quick look at the code and had a couple comments.

Comment thread cabal-install/main/Main.hs Resolved
Comment thread cabal-install/main/Main.hs Resolved
@ptkato

ptkato commented Dec 21, 2021

Copy link
Copy Markdown
Collaborator Author

It's ok, I don't think you'd need to be a maintainer to submit feedback. :P

Those are nice finds, though; I'll fix them.

@Mikolaj

Mikolaj commented Dec 21, 2021

Copy link
Copy Markdown
Member

@konsumlamm: could you have one last look at the documentation?

@konsumlamm

Copy link
Copy Markdown

Just a small comment, isn't -n the default now?

@Mikolaj

Mikolaj commented Dec 21, 2021

Copy link
Copy Markdown
Member

Just a small comment, isn't -n the default now?

By "now" do you mean 3.6.2 or master branch? The defaults have swapped on master branch.

@konsumlamm

Copy link
Copy Markdown

Just a small comment, isn't -n the default now?

By "now" do you mean 3.6.2 or master branch? The defaults have swapped on master branch.

I mean 3.6.2, yeah. So apparently the behaviour was changed back again.

@bacchanalia bacchanalia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also help text for cabal init that needs to be changed in Distribution.Client.Setup

@ptkato
ptkato force-pushed the cabal-init-start-dir branch 2 times, most recently from 05640f5 to 85a30f5 Compare December 21, 2021 19:58
@ptkato

ptkato commented Dec 22, 2021

Copy link
Copy Markdown
Collaborator Author

Oki, I believe we're all covered, yes?

@Mikolaj Mikolaj added the merge me Tell Mergify Bot to merge label Dec 22, 2021
@Mikolaj

Mikolaj commented Dec 22, 2021

Copy link
Copy Markdown
Member

Oki, I believe we're all covered, yes?

I think so. yes. More than usually, thanks to live feedback from a user, and moreover a user who is the original ticket creator.

@bacchanalia, is your review positive now? If so, could you tick it?

@Mikolaj

Mikolaj commented Dec 22, 2021

Copy link
Copy Markdown
Member

Doh, I've linked from all over the world to this issue, by mistake (off-by-1). I'm afraid we are famous now. ;)

Comment thread cabal-install/main/Main.hs Resolved
@Mikolaj Mikolaj removed the merge me Tell Mergify Bot to merge label Dec 22, 2021
@ptkato
ptkato force-pushed the cabal-init-start-dir branch from 85a30f5 to b484bcf Compare December 22, 2021 20:57

@bacchanalia bacchanalia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest changes look good to me.

@Mikolaj Mikolaj added the merge me Tell Mergify Bot to merge label Dec 22, 2021
@ptkato
ptkato force-pushed the cabal-init-start-dir branch from b484bcf to c43fd9b Compare December 22, 2021 23:15
@mergify
mergify Bot merged commit 0ba25d2 into haskell:master Dec 23, 2021
fgaz added a commit to fgaz/cabal that referenced this pull request Dec 24, 2021
@fgaz fgaz mentioned this pull request Dec 24, 2021
mergify Bot pushed a commit that referenced this pull request Dec 24, 2021
ptkato pushed a commit to ptkato/cabal that referenced this pull request Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Tell Mergify Bot to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow cabal init to create a new project directory

4 participants