Merge pull request #226 from yglukhov/actionRefresh

Renamed actionUpdate to actionRefresh
This commit is contained in:
Dominik Picheta 2016-04-13 20:58:42 +01:00
commit 8244bdf708
2 changed files with 8 additions and 8 deletions

View file

@ -55,7 +55,7 @@ proc update(options: Options) =
## ##
## If the download is not successful, an exception is raised. ## If the download is not successful, an exception is raised.
let parameter = let parameter =
if options.action.typ == actionUpdate: if options.action.typ == actionRefresh:
options.action.optionalURL options.action.optionalURL
else: else:
"" ""
@ -895,7 +895,7 @@ proc doAction(options: Options) =
echo("Pre-hook prevented further execution.") echo("Pre-hook prevented further execution.")
return return
case options.action.typ case options.action.typ
of actionUpdate: of actionRefresh:
update(options) update(options)
of actionInstall: of actionInstall:
let (_, pkgInfo) = install(options.action.packages, options) let (_, pkgInfo) = install(options.action.packages, options)

View file

@ -18,7 +18,7 @@ type
pkgInfoCache*: TableRef[string, PackageInfo] pkgInfoCache*: TableRef[string, PackageInfo]
ActionType* = enum ActionType* = enum
actionNil, actionUpdate, actionInit, actionDump, actionPublish, actionNil, actionRefresh, actionInit, actionDump, actionPublish,
actionInstall, actionSearch, actionInstall, actionSearch,
actionList, actionBuild, actionPath, actionUninstall, actionCompile, actionList, actionBuild, actionPath, actionUninstall, actionCompile,
actionCustom, actionTasks, actionVersion actionCustom, actionTasks, actionVersion
@ -27,7 +27,7 @@ type
case typ*: ActionType case typ*: ActionType
of actionNil, actionList, actionBuild, actionPublish, actionTasks, of actionNil, actionList, actionBuild, actionPublish, actionTasks,
actionVersion: nil actionVersion: nil
of actionUpdate: of actionRefresh:
optionalURL*: string # Overrides default package list. optionalURL*: string # Overrides default package list.
of actionInstall, actionPath, actionUninstall: of actionInstall, actionPath, actionUninstall:
packages*: seq[PkgTuple] # Optional only for actionInstall. packages*: seq[PkgTuple] # Optional only for actionInstall.
@ -111,7 +111,7 @@ proc parseActionType*(action: string): ActionType =
of "dump": of "dump":
result = actionDump result = actionDump
of "update", "refresh": of "update", "refresh":
result = actionUpdate result = actionRefresh
of "search": of "search":
result = actionSearch result = actionSearch
of "list": of "list":
@ -141,7 +141,7 @@ proc initAction*(options: var Options, key: string) =
options.action.projName = "" options.action.projName = ""
of actionDump: of actionDump:
options.action.projName = "" options.action.projName = ""
of actionUpdate: of actionRefresh:
options.action.optionalURL = "" options.action.optionalURL = ""
of actionSearch: of actionSearch:
options.action.search = @[] options.action.search = @[]
@ -215,7 +215,7 @@ proc parseArgument*(key: string, result: var Options) =
result.action.packages.add(pkgTup) result.action.packages.add(pkgTup)
else: else:
result.action.packages.add((key, VersionRange(kind: verAny))) result.action.packages.add((key, VersionRange(kind: verAny)))
of actionUpdate: of actionRefresh:
result.action.optionalURL = key result.action.optionalURL = key
of actionSearch: of actionSearch:
result.action.search.add(key) result.action.search.add(key)
@ -320,4 +320,4 @@ proc getProxy*(options: Options): Proxy =
else: "" else: ""
return newProxy($parsed, auth) return newProxy($parsed, auth)
else: else:
return nil return nil