Skip to content

Commit

Permalink
Support forcing download for outdatedness check
Browse files Browse the repository at this point in the history
  • Loading branch information
agross committed Jul 28, 2017
1 parent 5f68356 commit 27c522b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions completion/paket-completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ _paket-outdated() {
args=(
$global_options
"${(f)$(_paket_group_option 'specify dependency group (default: all groups)')}"
'(-f --force)'{-f,--force}'[force download and reinstallation of all dependencies]'
'(--ignore-constraints)'--ignore-constraints'[ignore version constraints in the paket.dependencies file]'
'(--pre --include-prereleases)'{--pre,--include-prereleases}'[consider prerelease versions as updates]'
)
Expand Down
2 changes: 2 additions & 0 deletions src/Paket/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ with
| Load_Script_Type_Legacy(_) -> "[obsolete]"

type OutdatedArgs =
| [<Unique;AltCommandLine("-f")>] Force
| [<Unique>] Ignore_Constraints

| [<Unique;AltCommandLine("-g")>] Group of name:string
Expand All @@ -181,6 +182,7 @@ with
interface IArgParserTemplate with
member this.Usage =
match this with
| Force -> "force download and reinstallation of all dependencies"
| Ignore_Constraints -> "ignore version constraints in the paket.dependencies file"

| Group(_) -> "specify dependency group (default: all groups)"
Expand Down
3 changes: 2 additions & 1 deletion src/Paket/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,14 @@ let install (results : ParseResults<_>) =
alternativeProjectRoot)

let outdated (results : ParseResults<_>) =
let force = results.Contains <@ OutdatedArgs.Force @>
let strict = results.Contains <@ OutdatedArgs.Ignore_Constraints @> |> not
let includePrereleases = results.Contains <@ OutdatedArgs.Include_Prereleases @>
let group =
(results.TryGetResult<@ OutdatedArgs.Group @>,
results.TryGetResult<@ OutdatedArgs.Group_Legacy @>)
|> legacyOption results "--group" "group"
Dependencies.Locate().ShowOutdated(strict, false, includePrereleases, group)
Dependencies.Locate().ShowOutdated(strict, force, includePrereleases, group)

let remove (results : ParseResults<_>) =
let packageName =
Expand Down

0 comments on commit 27c522b

Please sign in to comment.