Skip to content

Commit

Permalink
Throw cmderror for no-argument pkg> generate (#365)
Browse files Browse the repository at this point in the history
* Throw cmderror for no-argument pkg> generate

* add test
  • Loading branch information
mortenpi authored and KristofferC committed Jun 12, 2018
1 parent 7455f79 commit 13d0279
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions stdlib/Pkg/src/REPLMode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ function do_init!(ctx::Context, tokens::Vector{Token})
end

function do_generate!(ctx::Context, tokens::Vector{Token})
isempty(tokens) && cmderror("`generate` requires a project name as an argument")
local pkg
while !isempty(tokens)
token = popfirst!(tokens)
Expand Down
5 changes: 5 additions & 0 deletions stdlib/Pkg/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function git_init_package(tmp, path)
end


@testset "generate init args" begin
@test_throws CommandError pkg"generate"
@test_throws CommandError pkg"init Beep"
end

mktempdir() do project_path
cd(project_path) do
pushfirst!(LOAD_PATH, Base.parse_load_path("@"))
Expand Down

0 comments on commit 13d0279

Please sign in to comment.